static status_t usb_audio_free(void *cookie) { Device *device = (Device *)cookie; DriverSmartLock driverLock; // released on exit status_t status = device->Free(); for (int32 i = 0; i < MAX_DEVICES; i++) { if (gDevices[i] == device) { // the device is removed already but as it was open the // removed hook has not deleted the object gDevices[i] = NULL; delete device; TRACE("Device at %ld deleted.\n", i); break; } } return status; }
static status_t SiS19X_free(void* cookie) { Device* device = (Device*)cookie; return device->Free(); }