Re: [Pyobjc-dev] Memory management bug using .new() -- and another one?
Brought to you by:
ronaldoussoren
From: Ronald O. <ron...@ma...> - 2009-06-23 08:51:56
|
On 23 Jun, 2009, at 10:32, Dirk Stoop wrote: > Hi Ronald, > > I use objc.IBOutlet() all over the place, so I've tried a couple of > things. > > Short summary is: It definitely changes behavior, but it doesn't solve > the problem. That's rather annoying. BTW. The document that describes how outlets are managed: <http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt.pdf >. The document is rather vague on what happens when you don't have getter/setter methods (which you won't have when using objc.IBOutlet()). I'm pretty use an older document said that the NIB- loader will then set the instance variable without adjusting reference counts. I have to do some thinking on how to properly fix this, my best guess right now is to automaticly generate accessor methods for outlets in the ObjC class to ensure that the NIB loader will use a clearly defined mechanism to set references. The annoying bit is making sure that those accessor methods don't leak into the Python side, that would break a lot of existing code. Ronald |