Re: [Pyobjc-dev] Some PyObC tweaks for using EOF and custom frameworks
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2003-08-10 16:43:20
|
On Sunday, 10 August, 2003, at 17:27, Pierce T. Wetter III wrote: >>> >>> That probably doesn't help with objects that get invalidated. PyObjC >>> doesn't deal gracefully with objects that change their class. >> >> Yeah, it comes back as a "NoneType" object. after invalidation and >> throws an error. >> probably fixable with another [obj self] call before any method >> dispatching if I can find the place to do it. > > I found one spot: > > Changing > > #define PyObjCObject_GetObject(object) > (((PyObjCObject*)(object))->objc_object) > > to > > #define PyObjCObject_GetObject(object) > ([((PyObjCObject*)(object))->objc_object self]) > > in pyobjc.h seems to do it. > > There are probably better locations though. That's probably the best location, but I'm not entirely sure that everyone access the objc_object field through this macro. I'll probably add this change (and the change to objc_support.m) to an experimental tree to check if this has any negative effects. This may end up in the repository, probably as a configuration option. Ronald |