fix crash on app exit

This commit is contained in:
matthias.ringwald 2010-03-14 16:28:18 +00:00
parent 71d9d7cecb
commit 8149d2c7c9
2 changed files with 10 additions and 13 deletions

View File

@ -2,12 +2,10 @@
2009-11-08: Release 0.1
DONE:
- BTstackManager activated/deactivated/discovery
NEXT:
- BUG: bt_close crashes when used in CocoaTouch app
- BUG: BTdaemon crashes on iPhone when CocoaTouch app is closed
- add extern "C" to bstack methods
- see: http://stackoverflow.com/questions/376966/using-c-c-static-libraries-from-iphone-objectivec-apps
- Provide BTstackManager Objective-C class
- move connection methods to BTdevice (get more object oriented)
- initWithAddress:(bd_addr_t *)addr
@ -17,15 +15,12 @@ NEXT:
- figure out how to receive iPhone System Power IONotifications (in BTdaemon) to detect, when phone gets locked
- some trick
- use Cocoa run loop for background app?
- Add improved RFCOMM user-client
- use switch on RFCOMM control field in rfcomm.c packet handler
- move RFCOMM code into BTdaemon
- add timeouts to cocoa run loop
- L2CAP
- segmentation
- add timeouts to cocoa run loop
== Release 0.2 - Incoming L2CAP supported + improved Inq Dialog
- extend SpringBoard feedback
- show alerts/messages using SpringBoardAcccess, e.g. Bluetooth disconnected by remote device
- add code to notify about remote disconnets

View File

@ -495,7 +495,7 @@ void l2cap_unregister_service_internal(connection_t *connection, uint16_t psm){
l2cap_service_t *service = l2cap_get_service(psm);
if (service) return;
linked_list_remove(&l2cap_services, (linked_item_t *) service);
free( service );
free(service);
}
//
@ -515,11 +515,13 @@ void l2cap_close_connection(connection_t *connection){
// unregister services
l2cap_service_t *service;
for (it = (linked_item_t *) &l2cap_services; it ; it = it->next){
channel = (l2cap_channel_t *) it->next;
for (it = (linked_item_t *) l2cap_services; it ; ){
service = (l2cap_service_t *) it->next;
if (service->connection == connection){
it->next = it->next->next;
return;
it->next = service->item.next;
free(service);
} else {
it = it->next;
}
}
}