mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2025-03-26 05:35:29 +01:00
lib: force wait state after cancel of usb transfer
..and before handling usb events This avoids an occasional crash when closing the device on Windows. Also see https://github.com/libusb/libusb/issues/1043.
This commit is contained in:
parent
d770add42e
commit
2659e2df31
@ -1930,6 +1930,9 @@ int rtlsdr_read_async(rtlsdr_dev_t *dev, rtlsdr_read_async_cb_t cb, void *ctx,
|
|||||||
/* handle events after canceling
|
/* handle events after canceling
|
||||||
* to allow transfer status to
|
* to allow transfer status to
|
||||||
* propagate */
|
* propagate */
|
||||||
|
#ifdef _WIN32
|
||||||
|
Sleep(1);
|
||||||
|
#endif
|
||||||
libusb_handle_events_timeout_completed(dev->ctx,
|
libusb_handle_events_timeout_completed(dev->ctx,
|
||||||
&zerotv, NULL);
|
&zerotv, NULL);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user