Re: [Pyobjc-dev] issues with NSURL and NSWindow?
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2004-04-05 06:13:21
|
On 5-apr-04, at 6:05, b.bum wrote: > On Apr 4, 2004, at 8:59 PM, Bob Ippolito wrote: >> It's releasing something that was alloc'ed but not init'ed. It >> probably should bus error. I'm not sure how we are supposed to catch >> that anyway? I guess we would have to keep track to see if it was >> alloc'ed but not initialized, and then send it dealloc instead of >> release. >> >> This gets a bus error too, btw: >> #import <Foundation/Foundation.h> >> >> int main (int argc, char **argv) { >> NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; >> NSURL *url; >> url = [NSURL alloc]; >> [url release]; >> [pool release]; >> } > > That is a symptom of an earlier failure. The fact the PyObjC is > attempting to send initWithString instead of initWithString: is the > root cause (or else initWithString: wouldn't work, would it?). > > Can we catch the attempt to invoke a method that does not exist? We do that. As bob noted the problem is that we release an uninitialized object. I try to do the right thing when this happens, but that's obviously not good enough. It's probably better to just leak when this happens (and log/warn about this) Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 |