Re: [Pyobjc-dev] HelloWorld.py segfaults
Brought to you by:
ronaldoussoren
From: b.bum <bb...@ma...> - 2003-06-30 16:23:29
|
On Monday, June 30, 2003, at 5:27 AM, Just van Rossum wrote: > It doesn't. (It seems that delegates are not retained in general.) Correct. In general, delegates, observers, outlets and other "informal" connections between objects are not retained-- they are "weak references". Unfortunately, a weak reference in Objective-C is more or less an invitation for your app to crash when you didn't expect it to -- I have never agreed with the decision to use this implementation pattern nor have I ever seen a reasonable explanation as to why such a choice was made. Claims that doing so makes memory management easier are bogus. Given the number of apps that have shipped such that closing a document leads to a crasher at some later time (most likely because a notification was sent to a deceased observer), this has clearly caused a lot of hell in the development community. I would rather see apps that leak slightly than apps that crash at random because of retain/release issues. Leaks are much easier to fix than the latter. Garbage collection is not an excuse for lazy coding. You always have to clean up after yourself! b.bum |