When calling -.cxx_dealloc, look up the superclass before calling. This method

may destroy the receiver's class, if it's a user-generated one, so we can't
guarantee that it is valid after the call.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33701 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
theraven 2011-08-07 16:56:58 +00:00
parent 59469c7860
commit 8d699f6ff8

View file

@ -1436,12 +1436,13 @@ static id gs_weak_load(id obj)
newDestructor
= class_getMethodImplementation(destructorClass, cxx_destruct);
destructorClass = class_getSuperclass(destructorClass);
if (newDestructor != destructor)
{
newDestructor(self, cxx_destruct);
destructor = newDestructor;
}
destructorClass = class_getSuperclass(destructorClass);
}
return;
}