- Fix brackets to not perform a delete on a missing instance

- Security checks on dissapeared devices


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31448 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Ruiz Dorantes 2009-07-07 21:38:36 +00:00
parent f66bd6256a
commit 6d8521b1f4

View File

@ -154,9 +154,10 @@ void BluetoothServer::MessageReceived(BMessage *message)
case BT_MSG_REMOVE_DEVICE:
{
LocalDeviceImpl* lDeviceImpl = LocateDelegateFromMessage(message);
if (lDeviceImpl != NULL)
if (lDeviceImpl != NULL) {
fLocalDevicesList.RemoveItem(lDeviceImpl);
delete lDeviceImpl;
}
break;
}
@ -200,7 +201,8 @@ void BluetoothServer::MessageReceived(BMessage *message)
if (status != B_WOULD_BLOCK) {
reply.AddInt32("status", status);
message->SendReply(&reply);
printf("Sending reply message\n");
printf("Sending reply message for->\n");
message->PrintToStream();
}
}
@ -333,6 +335,10 @@ status_t
BluetoothServer::HandleSimpleRequest(BMessage* message, BMessage* reply)
{
LocalDeviceImpl* lDeviceImpl = LocateDelegateFromMessage(message);
if (lDeviceImpl == NULL) {
return B_ERROR;
}
const char* propertyRequested;
// Find out if there is a property being requested,
@ -362,8 +368,11 @@ BluetoothServer::HandleGetProperty(BMessage* message, BMessage* reply)
/* User side will look for the reply in a result field
* and will not care about status fields, therefore we return OK in all cases
*/
LocalDeviceImpl* lDeviceImpl = LocateDelegateFromMessage(message);
if (lDeviceImpl == NULL) {
return B_ERROR;
}
const char* propertyRequested;
// Find out if there is a property being requested,