mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-09 15:39:08 +00:00
fix double free in SpringBoardAccess
This commit is contained in:
parent
3d7d58e9fa
commit
8ce585cf3e
@ -22,7 +22,7 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
if (usage) {
|
||||
printf("Usage: %s add/remove StatuBarImageName", argv[0]);
|
||||
printf("Usage: %s add/remove StatuBarImageName\n", argv[0]);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -28,15 +28,13 @@ _ ## class ## $ ## name(self, sel, ## args)
|
||||
|
||||
|
||||
CFDataRef myCallBack(CFMessagePortRef local, SInt32 msgid, CFDataRef cfData, void *info) {
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
UIApplication *theApp = [UIApplication sharedApplication];
|
||||
|
||||
const char *data = (const char *) CFDataGetBytePtr(cfData);
|
||||
UInt16 dataLen = CFDataGetLength(cfData);
|
||||
|
||||
if (dataLen > 1 && data) {
|
||||
NSString * name = [[NSString stringWithCString:&data[1] encoding:NSASCIIStringEncoding] autorelease];
|
||||
NSString * name = [NSString stringWithCString:&data[1] encoding:NSASCIIStringEncoding];
|
||||
switch (data[0]){
|
||||
case SBAC_addStatusBarImage:
|
||||
[theApp addStatusBarImageNamed:name];
|
||||
@ -48,7 +46,6 @@ CFDataRef myCallBack(CFMessagePortRef local, SInt32 msgid, CFDataRef cfData, voi
|
||||
NSLog(@"Unknown command %u, len %u", data[0], dataLen);
|
||||
}
|
||||
}
|
||||
[pool release];
|
||||
return NULL; // as stated in header, both data and returnData will be released for us after callback returns
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user