[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ObjectiveC2 sync.m dealloc/synthesized setter issue.
From: |
David Chisnall |
Subject: |
Re: ObjectiveC2 sync.m dealloc/synthesized setter issue. |
Date: |
Thu, 10 Feb 2011 12:43:06 +0000 |
On 9 Feb 2011, at 04:36, Jason Felice wrote:
> If you call a synthesized setter in dealloc, you get a fault. The
> synthesized setter wants to sync, the object's "isa" has already been
> restored to pre-faux-lock-object-subclass; therefore, sync.m attempts to
> re-subclass-swizzle which fails at some assert within the runtime (I don't
> have the runtime built with debug).
This should have been fixed in libobjc2 some time ago (before 1.0, I think).
The dealloc method added by the lock class calls [super dealloc], then destroys
the lock class after it returns.
> Clearly, if it were to succeed, bad things would happen.
>
> OK, didn't look at SVN. We seem to have a better approach, though looks like
> we can never clean up locks.
Please test this with a vaguely recent svn and provide me with a simple test
case if it still doesn't work for you.
> Thought: we should still be able to swizzle 'dealloc', no? We just need to
> steal the dealloc of any object hierarchy root?
Yes, if you only had to deal with well-written code. Unfortunately, a load of
GNUstep code uses NSDeallocateObject(self) instead of calling [super dealloc].
David
-- Sent from my Difference Engine