mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Fix leaks
This commit is contained in:
parent
cf8c387900
commit
6f7a4d74c2
3 changed files with 12 additions and 5 deletions
|
@ -837,7 +837,7 @@ _arg_addr(NSInvocation *inv, int index)
|
|||
+ (NSInvocation*) _returnInvocationAndDestroyProxy: (id)proxy
|
||||
{
|
||||
NSInvocation *inv = [proxy _invocation];
|
||||
NSDeallocateObject(proxy);
|
||||
[proxy dealloc];
|
||||
return inv;
|
||||
}
|
||||
@end
|
||||
|
@ -888,6 +888,11 @@ _arg_addr(NSInvocation *inv, int index)
|
|||
o->target = RETAIN(t);
|
||||
return o;
|
||||
}
|
||||
- (void) dealloc
|
||||
{
|
||||
DESTROY(target);
|
||||
NSDeallocateObject(self);
|
||||
}
|
||||
- (NSInvocation*) _invocation
|
||||
{
|
||||
return invocation;
|
||||
|
|
|
@ -78,8 +78,8 @@ int main()
|
|||
pClass = NSClassFromString(@"InvokeProxy");
|
||||
|
||||
|
||||
tar = [tClass new];
|
||||
pxy = [[pClass alloc] initWithTarget:tar];
|
||||
tar = AUTORELEASE([tClass new]);
|
||||
pxy = AUTORELEASE([[pClass alloc] initWithTarget:tar]);
|
||||
TEST_INVOKE(@selector(retChar));
|
||||
[inv getReturnValue:&cret];
|
||||
PASS(cret == 99 &&
|
||||
|
@ -207,6 +207,8 @@ int main()
|
|||
PASS(NSEqualRects(rret, rarg) && NSEqualRects(rprx, rarg),
|
||||
"Can send/return NSRect");
|
||||
|
||||
free(cparg);
|
||||
free(cparg2);
|
||||
[arp release]; arp = nil;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -19,8 +19,8 @@ static int called = 0;
|
|||
|
||||
int main(void)
|
||||
{
|
||||
NSAutoreleasePool* pool = [NSAutoreleasePool new];
|
||||
NSMessageTest* test = [NSMessageTest new];
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
NSMessageTest *test = AUTORELEASE([NSMessageTest new]);
|
||||
|
||||
[NS_MESSAGE(test, methodToCall) invoke];
|
||||
|
||||
|
|
Loading…
Reference in a new issue