* on freeing, only remove the device when it is removed
* check if the device is still opened when waiting for data git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27310 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -191,7 +191,8 @@ usb_hid_free(void *cookie)
|
|||||||
HIDDevice *device = (HIDDevice *)cookie;
|
HIDDevice *device = (HIDDevice *)cookie;
|
||||||
mutex_lock(&sDriverLock);
|
mutex_lock(&sDriverLock);
|
||||||
status_t status = device->Free();
|
status_t status = device->Free();
|
||||||
if (gDeviceList->RemoveDevice(NULL, device) == B_OK) {
|
if (device->IsRemoved()
|
||||||
|
&& gDeviceList->RemoveDevice(NULL, device) == B_OK) {
|
||||||
// the device is removed already but as it was open the removed hook
|
// the device is removed already but as it was open the removed hook
|
||||||
// has not deleted the object
|
// has not deleted the object
|
||||||
delete device;
|
delete device;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ MouseDevice::Control(uint32 op, void *buffer, size_t length)
|
|||||||
// released in the callback function
|
// released in the callback function
|
||||||
status_t result = acquire_sem_etc(fTransferNotifySem, 1,
|
status_t result = acquire_sem_etc(fTransferNotifySem, 1,
|
||||||
B_CAN_INTERRUPT, 0);
|
B_CAN_INTERRUPT, 0);
|
||||||
if (result == B_INTERRUPTED)
|
if (result == B_INTERRUPTED && IsOpen())
|
||||||
continue;
|
continue;
|
||||||
else if (result != B_OK)
|
else if (result != B_OK)
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user