Commit 70a20d48 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: fix longstanding ~30KB memory leak in the AppleRemote wrapper

parent efac86c9
......@@ -544,7 +544,7 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
long usage;
long usagePage;
id object;
NSArray* elements = nil;
NSArray* elements;
NSDictionary* element;
IOReturn success;
......@@ -557,8 +557,6 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
success = (*handle)->copyMatchingElements(handle, NULL, (CFArrayRef*)&elements);
if (success == kIOReturnSuccess) {
[elements autorelease];
/*
cookies = calloc(NUMBER_OF_APPLE_REMOTE_ACTIONS, sizeof(IOHIDElementCookie));
memset(cookies, 0, sizeof(IOHIDElementCookie) * NUMBER_OF_APPLE_REMOTE_ACTIONS);
......@@ -588,7 +586,10 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
}
_allCookies = [[NSArray alloc] initWithArray: mutableAllCookies];
[mutableAllCookies release];
[elements release];
} else {
if (elements)
[elements release];
return NO;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment