Re: [Pyobjc-dev] threads + autoreleasepools
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2003-02-16 19:05:12
|
On Saturday, Feb 15, 2003, at 23:05 Europe/Amsterdam, Just van Rossum wrote: > When I use Cocoa functions in a different thread, I get lots of > warnings > like this: > > 2003-02-15 22:57:19.522 python2.3[9157] *** _NSAutoreleaseNoPool(): > Object 0x2878170 of class NSInvocation autoreleased with no pool in > place - just leaking > > However, creating an NSAutoreleasePool manually doesn't work the way I > think it should work: > >>>> NSAutoreleasePool.alloc().init() > Traceback (most recent call last): > File "<stdin>", line 1, in ? > ValueError: NSInvalidArgumentException - *** -[NSAutoreleasePool > retain]: Cannot retain an autorelease pool >>>> > > Any wisdom? Or is it a bug? It is a bug. Are you using libffi? I only get this error when not using libffi. The problem is that NSInvocation seems to call retain on the 'self' argument of the invocation. BTW. I'm not entirely sure that the bridge itself it thread-safe. Ronald |