Change-Id: Ib716a048b5d15bcdd5b5507c220261b1108cf462
_I("removed fd %d", fd);
}
+ /*
+ * libusb_exit() inernally calls fd_removed_cb() througth the callback of the
+ * "libusb_exit() -> usbi_io_exit() -> usbi_remove_poolfd() -> fd_removed_cb()" call path.
+ *
+ * The gloabl variable context is referenced in fd_removed_cb().
+ * So, libusb_exit() should be called before context is cleaned up.
+ *
+ */
libusb_exit(context->lusb_ctx);
g_list_free(context->gio_channels);
pthread_mutex_destroy(&context->channel_list_lock);