Re: [Pyobjc-dev] Bridging NSMutableString, a compromise
Brought to you by:
ronaldoussoren
From: <bb...@ma...> - 2003-02-07 20:53:59
|
On Friday, Feb 7, 2003, at 15:29 US/Eastern, Just van Rossum wrote: > We're making this way to hard for ourselves. This weakref idea is an > attempt to try to hide a flaw in Cocoa (that some objects don't incref > an object while still storing a reference; it's a poor man's weak ref > scheme and it sucks). It will be hard to do right. It is easy to work > around in Python code. Let's make it a FAQ and move on. Huh? The weakref idea was to take advantage of the callback that happens when the object is finalized such that the object could be 'unbridged'. If we can receive notification from Python of when the Python side of the bridge is done with the PyString, the bridging of the NSString<->PyString can be broken, the NSString side of things can leave on in its unbridged state, and nothing gets lost. I hadn't remotely considered the situation where some Cocoa objects don't implement the concept of 'weakref' as 'just grab a pointer and don't tell anyone or anything about it'. b.bum |