Issue #36 resolved

Explicitly state that GC is not supported in the documentation

Ronald Oussoren avatarRonald Oussoren created an issue

PyObjC's documentation should explicitly mention that Objective-C garbage collection (GC) is not supported.

The reasons for that:

  • PyObjC's core tries to maintain strong references when GC is active by using CFRetain/CFRelease, but I haven't reviewed if the data structures used are safe w.r.t. GC (CFHashTables and the like)

  • The OC_* classes and generated classes have a -dealloc method for cleaning up (such as Py_DECREF-ing Python objects), but there is no finalize method for use with GC (hence Python references will be leaked)

  • The CFRetain/CFRelease code makes live harder when trying to interact nicely with ARC (that is, it should be possible to use the ARC runtime functions that avoid hitting the autorelease pool when using PyObjC, but using CFRetain makes that slightly harder than I'd like)

  • There might be race conditions when using GC: PyObjC has a data structure that maps ObjC objects to Python objects, those could end up containing references to dead but not yet finalized objects, and that could cause problems later on.

All in all it will take some serious effort to make PyObjC GC-safe. As GC is on the way out (GC is deprecated in OSX 10.8) it is not worthwhile to spent time on this.

Comments (1)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.