diff --git a/src/calibre/devices/mtp/windows/wpd.cpp b/src/calibre/devices/mtp/windows/wpd.cpp index 889a3e02c5..d7d1a11eaa 100644 --- a/src/calibre/devices/mtp/windows/wpd.cpp +++ b/src/calibre/devices/mtp/windows/wpd.cpp @@ -45,16 +45,16 @@ wpd_init(PyObject *self, PyObject *args) { static PyObject * wpd_uninit(PyObject *self, PyObject *args) { - if (_com_initialized) { - CoUninitialize(); - _com_initialized = 0; - } - if (portable_device_manager != NULL) { portable_device_manager->Release(); portable_device_manager = NULL; } + if (_com_initialized) { + CoUninitialize(); + _com_initialized = 0; + } + Py_RETURN_NONE; }