From ae1fd87f0280e089c58b6a1b48881e6da449ee85 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 14 Mar 2023 21:37:22 +0100 Subject: [PATCH 1/2] Fix crash starting LimeSDR source without device This change fixes crash when a LimeSDR source is started without an actual device selected. --- source_modules/limesdr_source/src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source_modules/limesdr_source/src/main.cpp b/source_modules/limesdr_source/src/main.cpp index 5f05d203..96fb55ac 100644 --- a/source_modules/limesdr_source/src/main.cpp +++ b/source_modules/limesdr_source/src/main.cpp @@ -319,6 +319,7 @@ private: static void start(void* ctx) { LimeSDRSourceModule* _this = (LimeSDRSourceModule*)ctx; if (_this->running) { return; } + if (_this->devCount == 0) { return; } // Open device _this->openDev = NULL; From 1e5601e773622ad0722066667f707f018c559af4 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Tue, 14 Mar 2023 22:17:47 +0100 Subject: [PATCH 2/2] Better check Need to check if a device is actually selected, not just if there is one to select --- source_modules/limesdr_source/src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source_modules/limesdr_source/src/main.cpp b/source_modules/limesdr_source/src/main.cpp index 96fb55ac..5f7f4508 100644 --- a/source_modules/limesdr_source/src/main.cpp +++ b/source_modules/limesdr_source/src/main.cpp @@ -319,7 +319,7 @@ private: static void start(void* ctx) { LimeSDRSourceModule* _this = (LimeSDRSourceModule*)ctx; if (_this->running) { return; } - if (_this->devCount == 0) { return; } + if (_this->selectedDevName.empty()) { return; } // Open device _this->openDev = NULL; @@ -547,4 +547,4 @@ MOD_EXPORT void _DELETE_INSTANCE_(ModuleManager::Instance* instance) { MOD_EXPORT void _END_() { config.disableAutoSave(); config.save(); -} \ No newline at end of file +}