mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-31 19:20:26 +00:00
fix leaking in persistent_rfcomm_channel for iOS
This commit is contained in:
parent
a9481169a5
commit
5f5abb394b
@ -239,6 +239,11 @@ static void addService(NSString * serviceName, int channel){
|
|||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t persistent_rfcomm_channel(char *serviceName){
|
static uint8_t persistent_rfcomm_channel(char *serviceName){
|
||||||
|
|
||||||
|
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||||
|
|
||||||
|
NSLog(@"persistent_rfcomm_channel for %s", serviceName);
|
||||||
|
|
||||||
// find existing entry
|
// find existing entry
|
||||||
NSString *serviceString = [NSString stringWithUTF8String:serviceName];
|
NSString *serviceString = [NSString stringWithUTF8String:serviceName];
|
||||||
NSMutableDictionary *serviceEntry = [rfcomm_services objectForKey:serviceString];
|
NSMutableDictionary *serviceEntry = [rfcomm_services objectForKey:serviceString];
|
||||||
@ -261,6 +266,8 @@ static uint8_t persistent_rfcomm_channel(char *serviceName){
|
|||||||
|
|
||||||
db_synchronize();
|
db_synchronize();
|
||||||
|
|
||||||
|
[pool release];
|
||||||
|
|
||||||
return channel;
|
return channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user