diff --git a/src/device.c b/src/device.c index 0fa4e7e..2aa6289 100644 --- a/src/device.c +++ b/src/device.c @@ -315,6 +315,10 @@ dc_device_close (dc_device_t *device) if (device->vtable->close == NULL) return DC_STATUS_UNSUPPORTED; + // Disable the cancellation callback. + device->cancel_callback = NULL; + device->cancel_userdata = NULL; + return device->vtable->close (device); }