[Pyobjc-dev] Re: [Pyobjc-checkins] CVS: pyobjc/Modules/objc class-builder.m,1.7,1.8 pyobjc.h,1.8,1.9
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2002-12-15 19:57:08
|
On Sunday, Dec 15, 2002, at 20:36 Europe/Amsterdam, Ronald Oussoren wrote: [most of the patch removed] > ! if (obj->ob_refcnt <= 0) { > ! > ! /* Remove reference to the Python object. We don't need it > ! * any more (because the ObjCObject code will remove it > ! * when this function returns) and [super release] may > ! * call back to us some time later on ([NSWindow release] in > ! * a seperator thread). > ! */ > ! if (ObjC_SetPythonImplementation(self, 0) == -1) { > ! ObjCErr_ToObjC(); > ! return; > ! } > ! After I checked this in it came to my mind that changing the class of remaining half of the object might be a cleaner way to do. Currently the program will fail because of unimplemented methods if [super release] calls methods that were overridden in Python. As the user cannot do anything about this just changing the type of 'self' might be more usefull ('self->isa = self->isa->superclass;' instead of the if-statement in the code above). Ronald |