mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 01:31:08 +00:00
Use get_imp() to get method implementation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26359 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c895d41e78
commit
4fb2f3c708
2 changed files with 14 additions and 24 deletions
|
@ -1,3 +1,8 @@
|
|||
2008-03-19 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSAutoreleasePool.m: Use get_imp() to fetch the
|
||||
implementation of the release method.
|
||||
|
||||
2008-03-19 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/DocMakefile: include GNUstep.h
|
||||
|
|
|
@ -406,31 +406,16 @@ static IMP initImp;
|
|||
hash = (((unsigned)(uintptr_t)c) >> 3) & 0x0f;
|
||||
if (classes[hash] != c)
|
||||
{
|
||||
IMP imp;
|
||||
|
||||
#if 1
|
||||
if (GSObjCIsInstance(anObject))
|
||||
{
|
||||
/* We call instanceMethodForSelector: on the class
|
||||
* rather than methodForSelector: because EOFault
|
||||
* implements the former but not the latter.
|
||||
/* If anObject was an instance, c is it's class.
|
||||
* If anObject was a class, c is its metaclass.
|
||||
* Either way, get_imp() should get the appropriate pointer.
|
||||
* If anObject is a proxy to something,
|
||||
* the +instanceMethodForSelector: and -methodForSelector:
|
||||
* methods may not exist, but get_imp() will return the
|
||||
* address of the forwarding method if necessary.
|
||||
*/
|
||||
imp = [c instanceMethodForSelector: releaseSel];
|
||||
}
|
||||
else
|
||||
{
|
||||
imp = [c methodForSelector: releaseSel];
|
||||
}
|
||||
if (imp == 0)
|
||||
{
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"nul release for object in autorelease pool"];
|
||||
}
|
||||
#else
|
||||
imp = get_imp(anObject, @selector(release));
|
||||
#endif
|
||||
imps[hash] = get_imp(c, @selector(release));
|
||||
classes[hash] = c;
|
||||
imps[hash] = imp;
|
||||
}
|
||||
(imps[hash])(anObject, releaseSel);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue