From 24a12a44d1b59a4aa762894ce9d26483cdc82239 Mon Sep 17 00:00:00 2001 From: Hoernchen Date: Tue, 10 Apr 2012 15:13:57 +0200 Subject: [PATCH] reorder calls to prevent a crash Signed-off-by: Steve Markgraf --- src/rtl-sdr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rtl-sdr.c b/src/rtl-sdr.c index 3767294..db214e2 100644 --- a/src/rtl-sdr.c +++ b/src/rtl-sdr.c @@ -813,11 +813,11 @@ int rtlsdr_close(rtlsdr_dev_t *dev) rtlsdr_deinit_baseband(dev); + _rtlsdr_free_async_buffers(dev); + libusb_release_interface(dev->devh, 0); libusb_close(dev->devh); - _rtlsdr_free_async_buffers(dev); - libusb_exit(dev->ctx); free(dev);