[Pyobjc-dev] Re: [Pyobjc-checkins] CVS: pyobjc/Modules/objc objc_util.h,1.24,1.25 objc_util.m,1.48,1
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2004-04-07 07:21:35
|
On 6-apr-04, at 18:32, Bob Ippolito wrote: > Update of /cvsroot/pyobjc/pyobjc/Modules/objc > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21862 > > Modified Files: > objc_util.h objc_util.m > Log Message: > move the threadstate autoreleasepool key name into a macro so that > it can be checked when calling _into_ ObjC at some point so that python > threads can create an NSAutoreleasePool and call +[NSThread > currentThread] > (not necessarily in that order). I'm probably pretty dense (no coffee yet), but why is PyObjCGILState_Ensure necessary at all? This seems to create an arbitrary NSAutoreleasePool the first time someone calls into python from ObjC, and that might not play nicely with existing pool (e.g. what if the calling code already created a pool and later releases that to clean up memory, our pool might contain objects that should be cleaned up). It should be possible to create a new autorelease pool inside a thread before doing anything else with Cocoa. Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 |