if (ret != MTP_ERROR_NONE)
return ret;
- mtp_ctx->is_running = false;
-
if (mtp_ctx->c_thread != NULL) {
g_thread_join(mtp_ctx->c_thread);
g_thread_unref(mtp_ctx->c_thread);
g_main_loop_run(mtp_ctx->main_loop);
EXIT:
+ g_thread_pool_free(mtp_ctx->device_list->threads, true, true);
+
/* LCOV_EXCL_START */
ret = __daemon_deinitalize(mtp_ctx);
if (ret != MTP_ERROR_NONE)
if (mtp_ctx->device_list->device_num == 0) {
mtp_daemon_gdbus_emit_event(MTP_INITIATOR_EVENT_TURNED_OFF, 0, mtp_ctx);
+ mtp_ctx->is_running = false;
g_main_loop_quit(mtp_ctx->main_loop);
}
}
MTP_LOGE("dispatch thread created");
- struct timeval tv = {0, 200000};
while (mtp_ctx->is_running) {
- libusb_handle_events_timeout_completed(mtp_ctx->usb_ctx, &tv, NULL);
+ libusb_handle_events_completed(mtp_ctx->usb_ctx, NULL);
}
g_thread_exit(NULL);