From 0c6842ff686938c5615ed87f35d597d0ce95ca71 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sat, 6 Apr 2024 20:54:57 +0200 Subject: [PATCH 01/16] Add cmake option to optionally compile with LeakSanitizer Alse change the description of the existing option SANITIZE_ADDRESS to avoid ambiguity. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe3b62b2d2..cd74fddff5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,8 @@ set(sdrangel_VERSION_SUFFIX "") # SDRAngel cmake options option(DEBUG_OUTPUT "Print debug messages" OFF) -option(SANITIZE_ADDRESS "Activate memory address sanitization" OFF) +option(SANITIZE_ADDRESS "Activate detection of uninitialized memory (AddressSanitizer)" OFF) +option(SANITIZE_MEMORY "Activate detection of leaked memory (LeakSanitizer)" OFF) option(RX_SAMPLE_24BIT "Internal 24 bit Rx DSP" ON) option(BUILD_SERVER "Build Server" ON) option(BUILD_GUI "Build GUI" ON) From 87be13fcae5d311b25a0c00e4a944f09cbf743bf Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sat, 6 Apr 2024 18:50:08 +0200 Subject: [PATCH 02/16] Fix memleaks found with AddressSanitizer/LeakSanitizer Found with: ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel Fixes: Direct leak of 72 byte(s) in 1 object(s) allocated from: #0 0x7f7b94ef46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7f7b929ff74c in MainSettings::load() sdrbase/settings/mainsettings.cpp:153 #2 0x7f7b947614f6 in MainWindow::loadSettings() sdrgui/mainwindow.cpp:1230 #3 0x7f7b94759e11 in MainWindow::MainWindow(qtwebapp::LoggerWithFile*, MainParser const&, QWidget*) sdrgui/mainwindow.cpp:211 #4 0x55b694e0a175 in runQtApplication app/main.cpp:196 #5 0x55b694e07ab7 in main app/main.cpp:248 #6 0x7f7b8f4456c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 Indirect leak of 136 byte(s) in 1 object(s) allocated from: #0 0x7f7b94ef46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7f7b929e734d in QList::node_construct(QList::Node*, Preset const&) /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:465 #2 0x7f7b929e734d in QList::append(Preset const&) /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:625 #3 0x7f7b929e734d in QList::push_back(Preset const&) /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:377 #4 0x7f7b929e734d in Configuration::deserialize(QByteArray const&) sdrbase/settings/configuration.cpp:112 #5 0x7f7b929ff934 in MainSettings::load() sdrbase/settings/mainsettings.cpp:155 #6 0x7f7b947614f6 in MainWindow::loadSettings() sdrgui/mainwindow.cpp:1230 #7 0x7f7b94759e11 in MainWindow::MainWindow(qtwebapp::LoggerWithFile*, MainParser const&, QWidget*) sdrgui/mainwindow.cpp:211 #8 0x55b694e0a175 in runQtApplication app/main.cpp:196 #9 0x55b694e07ab7 in main app/main.cpp:248 #10 0x7f7b8f4456c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 Indirect leak of 32 byte(s) in 1 object(s) allocated from: #0 0x7f7b94ef46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7f7b929e9706 in QList::node_construct(QList::Node*, Preset::DeviceConfig const&) /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:465 #2 0x7f7b929e9706 in QList::append(Preset::DeviceConfig const&) /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:625 #3 0x7f7b929f627c in Preset::deserialize(QByteArray const&) sdrbase/settings/preset.cpp:193 #4 0x7f7b929e74ca in Configuration::deserialize(QByteArray const&) sdrbase/settings/configuration.cpp:113 #5 0x7f7b929ff934 in MainSettings::load() sdrbase/settings/mainsettings.cpp:155 #6 0x7f7b947614f6 in MainWindow::loadSettings() sdrgui/mainwindow.cpp:1230 #7 0x7f7b94759e11 in MainWindow::MainWindow(qtwebapp::LoggerWithFile*, MainParser const&, QWidget*) sdrgui/mainwindow.cpp:211 #8 0x55b694e0a175 in runQtApplication app/main.cpp:196 #9 0x55b694e07ab7 in main app/main.cpp:248 #10 0x7f7b8f4456c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 --- sdrbase/settings/mainsettings.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sdrbase/settings/mainsettings.cpp b/sdrbase/settings/mainsettings.cpp index b2ea29bbcd..92c0f199bc 100644 --- a/sdrbase/settings/mainsettings.cpp +++ b/sdrbase/settings/mainsettings.cpp @@ -52,6 +52,11 @@ MainSettings::~MainSettings() { delete m_pluginPresets[i]; } + + for (int i = 0; i < m_configurations.count(); ++i) + { + delete m_configurations[i]; + } } QString MainSettings::getFileLocation() const From dbf630c424e877630038c567441845b6f4090627 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sat, 6 Apr 2024 20:53:21 +0200 Subject: [PATCH 03/16] Fix memleaks found with AddressSanitizer/LeakSanitizer Fixes: Direct leak of 32 byte(s) in 1 object(s) allocated from: #0 0x7eff8bcf46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7eff897b484d in DeviceUserArgs::serialize() const sdrbase/device/deviceuserargs.cpp:43 #2 0x7eff897f4904 in MainSettings::save() const sdrbase/settings/mainsettings.cpp:237 #3 0x7eff8b578654 in MainWindow::closeEvent(QCloseEvent*) sdrgui/mainwindow.cpp:1749 #4 0x7eff877a5dc7 in QWidget::event(QEvent*) (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x1a5dc7) (BuildId: 983eca66d9695a1892aa796da4160d8d6f9b9ac4) Direct leak of 32 byte(s) in 1 object(s) allocated from: #0 0x7eff8bcf46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7eff897b484d in DeviceUserArgs::serialize() const sdrbase/device/deviceuserargs.cpp:43 #2 0x7eff897f4904 in MainSettings::save() const sdrbase/settings/mainsettings.cpp:237 #3 0x7eff8b552c9a in MainWindow::~MainWindow() sdrgui/mainwindow.cpp:326 #4 0x564e8b36e1e5 in runQtApplication app/main.cpp:212 #5 0x564e8b36bab7 in main app/main.cpp:248 #6 0x7eff862456c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 --- sdrbase/device/deviceuserargs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdrbase/device/deviceuserargs.cpp b/sdrbase/device/deviceuserargs.cpp index aae94111f8..384abe7611 100644 --- a/sdrbase/device/deviceuserargs.cpp +++ b/sdrbase/device/deviceuserargs.cpp @@ -40,8 +40,8 @@ QByteArray DeviceUserArgs::serialize() const { SimpleSerializer s(1); QByteArray data; - QDataStream *stream = new QDataStream(&data, QIODevice::WriteOnly); - *stream << m_argsByDevice; + QDataStream stream(&data, QIODevice::WriteOnly); + stream << m_argsByDevice; s.writeBlob(1, data); return s.final(); } From 8647a991a417655a5d0e4a0eac24d480b4fc45a3 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sat, 6 Apr 2024 21:00:59 +0200 Subject: [PATCH 04/16] Fix memleak found with AddressSanitizer/LeakSanitizer Found with: ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel Fixes: Direct leak of 16 byte(s) in 1 object(s) allocated from: #0 0x7ff2588f46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7ff256723dd0 in MainCore::appendFeatureSet() sdrbase/maincore.cpp:190 #2 0x7ff25817fb89 in MainWindow::addFeatureSet() sdrgui/mainwindow.cpp:1191 #3 0x7ff25815a4d0 in MainWindow::MainWindow(qtwebapp::LoggerWithFile*, MainParser const&, QWidget*) sdrgui/mainwindow.cpp:250 #4 0x559632289175 in runQtApplication app/main.cpp:196 #5 0x559632286ab7 in main app/main.cpp:248 #6 0x7ff252e456c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 --- sdrbase/maincore.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/sdrbase/maincore.cpp b/sdrbase/maincore.cpp index ac5c74066e..dcb11060c0 100644 --- a/sdrbase/maincore.cpp +++ b/sdrbase/maincore.cpp @@ -209,6 +209,7 @@ void MainCore::removeLastFeatureSet() FeatureSet *featureSet = m_featureSets.back(); m_featureSetsMap.remove(featureSet); m_featureSets.pop_back(); + delete featureSet; } } From cc6aa7591207e1a578df572494f987ea46e1f1e5 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sat, 6 Apr 2024 21:28:11 +0200 Subject: [PATCH 05/16] Fix memleaks found with AddressSanitizer/LeakSanitizer Found with: ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel Fixes: Direct leak of 56 byte(s) in 1 object(s) allocated from: #0 0x7f9d7d0f46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7f9d7af247aa in MainCore::appendDeviceSet(int) sdrbase/maincore.cpp:219 #2 0x7f9d7c95c8a5 in MainWindow::sampleSourceAdd(Workspace*, Workspace*, int) sdrgui/mainwindow.cpp:359 #3 0x7f9d7c97ce3c in MainWindow::loadConfiguration(Configuration const*, bool) sdrgui/mainwindow.cpp:1439 #4 0x7f9d7c95a610 in MainWindow::MainWindow(qtwebapp::LoggerWithFile*, MainParser const&, QWidget*) sdrgui/mainwindow.cpp:261 #5 0x562f7c492175 in runQtApplication app/main.cpp:196 #6 0x562f7c48fab7 in main app/main.cpp:248 #7 0x7f9d776456c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 and 34 others that I'm not copying here. --- sdrbase/maincore.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/sdrbase/maincore.cpp b/sdrbase/maincore.cpp index dcb11060c0..e6070aedb6 100644 --- a/sdrbase/maincore.cpp +++ b/sdrbase/maincore.cpp @@ -228,6 +228,7 @@ void MainCore::removeLastDeviceSet() DeviceSet *deviceSet = m_deviceSets.back(); m_deviceSetsMap.remove(deviceSet); m_deviceSets.pop_back(); + delete deviceSet; } } From 08c0668dcbfd3b13a492fd4975c56e3876f6e651 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sat, 6 Apr 2024 21:48:01 +0200 Subject: [PATCH 06/16] Fix memleaks found with AddressSanitizer/LeakSanitizer Found with: ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel Fixes: Indirect leak of 16 byte(s) in 1 object(s) allocated from: #0 0x7faba78f46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7faba73281e1 in GLShaderSpectrogram::initializeGL(int, int) sdrgui/gui/glshaderspectrogram.cpp:118 #2 0x7faba7369b54 in GLSpectrumView::initializeGL() sdrgui/gui/glspectrumview.cpp:937 #3 0x7faba33c4f45 in QOpenGLWidget::resizeEvent(QResizeEvent*) (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x1c4f45) (BuildId: 983eca66d9695a1892aa796da4160d8d6f9b9ac4) --- sdrgui/gui/glshaderspectrogram.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdrgui/gui/glshaderspectrogram.cpp b/sdrgui/gui/glshaderspectrogram.cpp index 8fd07b3c04..a46f5fb053 100644 --- a/sdrgui/gui/glshaderspectrogram.cpp +++ b/sdrgui/gui/glshaderspectrogram.cpp @@ -514,6 +514,8 @@ void GLShaderSpectrogram::drawSurface(SpectrumSettings::SpectrogramStyle style, void GLShaderSpectrogram::cleanup() { + delete m_vao; + m_vao = nullptr; delete m_programShaded; m_programShaded = nullptr; delete m_programSimple; From f52d371726b98ca552629f2c7741b8d332700548 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sun, 7 Apr 2024 13:10:20 +0200 Subject: [PATCH 07/16] Fix memleaks found with AddressSanitizer/LeakSanitizer Found with: ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel Fixes: Direct leak of 176096 byte(s) in 5503 object(s) allocated from: #0 0x7f3a464f46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7f3a44009219 in Airline::Init::Init() sdrbase/util/airlines.cpp:5559 #2 0x7f3a43dc797d in _sub_I_65535_0.0 (build/lib/libsdrbase.so+0x3c797d) (BuildId: fb568b705538a6e506ee23027626f4366b25aa50) #3 0x7f3a46c6ce3d in call_init elf/dl-init.c:74 #4 0x7f3a46c6ce3d in call_init elf/dl-init.c:26 --- sdrbase/util/airlines.cpp | 5 +++++ sdrbase/util/airlines.h | 1 + 2 files changed, 6 insertions(+) diff --git a/sdrbase/util/airlines.cpp b/sdrbase/util/airlines.cpp index 75fe7fc163..1a3f3dd2f5 100644 --- a/sdrbase/util/airlines.cpp +++ b/sdrbase/util/airlines.cpp @@ -5560,3 +5560,8 @@ Airline::Init::Init() s += 4; } } + +Airline::Init::~Init() +{ + qDeleteAll(m_icaoHash); +} diff --git a/sdrbase/util/airlines.h b/sdrbase/util/airlines.h index 7eed494f89..34ac5890bf 100644 --- a/sdrbase/util/airlines.h +++ b/sdrbase/util/airlines.h @@ -55,6 +55,7 @@ class SDRBASE_API Airline { friend struct Init; struct Init { Init(); + ~Init(); static const char *m_airlines[]; }; static Init m_init; From 3fb678272d0fc175b38c0fcc7ab6bccaa5a1eb58 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Wed, 1 May 2024 15:22:29 +0200 Subject: [PATCH 08/16] Fix memleaks found with AddressSanitizer/LeakSanitizer Fixes: Direct leak of 16 byte(s) in 1 object(s) allocated from: #0 0x7efeb72f46b8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7efe834b65a2 in WebServer::WebServer(unsigned short&, QObject*) sdrangel/plugins/feature/map/webserver.cpp:34 #2 0x7efe834bc342 in MapGUI::MapGUI(PluginAPI*, FeatureUISet*, Feature*, QWidget*) sdrangel/plugins/feature/map/mapgui.cpp:265 #3 0x7efe835372f4 in MapGUI::create(PluginAPI*, FeatureUISet*, Feature*) sdrangel/plugins/feature/map/mapgui.cpp:66 #4 0x7efe834b5471 in MapPlugin::createFeatureGUI(FeatureUISet*, Feature*) const sdrangel/plugins/feature/map/mapplugin.cpp:72 #5 0x7efeb6b416c2 in FeatureUISet::loadFeatureSetSettings(FeatureSetPreset const*, PluginAPI*, WebAPIAdapterInterface*, QList*, Workspace*) sdrangel/sdrgui/feature/featureuiset.cpp:185 #6 0x7efeb67e9b41 in MainWindow::loadConfiguration(Configuration const*, bool) sdrangel/sdrgui/mainwindow.cpp:1503 #7 0x7efeb6730e3e in MainWindow::MainWindow(qtwebapp::LoggerWithFile*, MainParser const&, QWidget*) sdrangel/sdrgui/mainwindow.cpp:257 #8 0x557281218bad in runQtApplication sdrangel/app/main.cpp:196 #9 0x5572812194a3 in main sdrangel/app/main.cpp:248 #10 0x7efeb10456c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 and others --- plugins/feature/map/webserver.cpp | 6 ++++++ plugins/feature/map/webserver.h | 1 + 2 files changed, 7 insertions(+) diff --git a/plugins/feature/map/webserver.cpp b/plugins/feature/map/webserver.cpp index 3a2eb29240..cb9116cd33 100644 --- a/plugins/feature/map/webserver.cpp +++ b/plugins/feature/map/webserver.cpp @@ -15,6 +15,7 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -41,6 +42,11 @@ WebServer::WebServer(quint16 &port, QObject* parent) : m_mimeTypes.insert(".geojson", new MimeType("application/geo+json")); } +WebServer::~WebServer() +{ + qDeleteAll(m_mimeTypes); +} + void WebServer::incomingConnection(qintptr socket) { QTcpSocket* s = new QTcpSocket(this); diff --git a/plugins/feature/map/webserver.h b/plugins/feature/map/webserver.h index 7aa5070da0..b24f92ba42 100644 --- a/plugins/feature/map/webserver.h +++ b/plugins/feature/map/webserver.h @@ -64,6 +64,7 @@ class WebServer : public QTcpServer public: WebServer(quint16 &port, QObject* parent = 0); + ~WebServer(); void incomingConnection(qintptr socket) override; void addPathSubstitution(const QString &from, const QString &to); void addSubstitution(QString path, QString from, QString to); From de131d1f6d91cc6cc4bc3aeb91b6a5064aec32c2 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Wed, 1 May 2024 15:40:01 +0200 Subject: [PATCH 09/16] Fix memleaks found with AddressSanitizer/LeakSanitizer Found with: ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel Fixes: Direct leak of 8 byte(s) in 1 object(s) allocated from: #0 0x7efeb72f46b8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7efe83515718 in WebServer::addSubstitution(QString, QString, QString) sdrangel/plugins/feature/map/webserver.cpp:84 #2 0x7efe83559c9e in MapGUI::applyMap3DSettings(bool) sdrangel/plugins/feature/map/mapgui.cpp:1789 #3 0x7efe8355e483 in MapGUI::displaySettings() sdrangel/plugins/feature/map/mapgui.cpp:1964 #4 0x7efe834be0f6 in MapGUI::MapGUI(PluginAPI*, FeatureUISet*, Feature*, QWidget*) sdrangel/plugins/feature/map/mapgui.cpp:376 #5 0x7efe835372f4 in MapGUI::create(PluginAPI*, FeatureUISet*, Feature*) sdrangel/plugins/feature/map/mapgui.cpp:66 #6 0x7efe834b5471 in MapPlugin::createFeatureGUI(FeatureUISet*, Feature*) const sdrangel/plugins/feature/map/mapplugin.cpp:72 #7 0x7efeb6b416c2 in FeatureUISet::loadFeatureSetSettings(FeatureSetPreset const*, PluginAPI*, WebAPIAdapterInterface*, QList*, Workspace*) sdrangel/sdrgui/feature/featureuiset.cpp:185 #8 0x7efeb67e9b41 in MainWindow::loadConfiguration(Configuration const*, bool) sdrangel/sdrgui/mainwindow.cpp:1503 #9 0x7efeb6730e3e in MainWindow::MainWindow(qtwebapp::LoggerWithFile*, MainParser const&, QWidget*) sdrangel/sdrgui/mainwindow.cpp:257 #10 0x557281218bad in runQtApplication sdrangel/app/main.cpp:196 #11 0x5572812194a3 in main sdrangel/app/main.cpp:248 #12 0x7efeb10456c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 --- plugins/feature/map/webserver.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/feature/map/webserver.cpp b/plugins/feature/map/webserver.cpp index cb9116cd33..aa299cc283 100644 --- a/plugins/feature/map/webserver.cpp +++ b/plugins/feature/map/webserver.cpp @@ -44,6 +44,7 @@ WebServer::WebServer(quint16 &port, QObject* parent) : WebServer::~WebServer() { + qDeleteAll(m_substitutions); qDeleteAll(m_mimeTypes); } From 6627b0c377ae860ebab3cc59fbc3aff1d2b73732 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Fri, 3 May 2024 23:59:08 +0200 Subject: [PATCH 10/16] Use qDeleteAll() for brevity --- sdrbase/settings/mainsettings.cpp | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/sdrbase/settings/mainsettings.cpp b/sdrbase/settings/mainsettings.cpp index 92c0f199bc..fbf8bf1b6d 100644 --- a/sdrbase/settings/mainsettings.cpp +++ b/sdrbase/settings/mainsettings.cpp @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -34,29 +35,11 @@ MainSettings::MainSettings() : MainSettings::~MainSettings() { - for (int i = 0; i < m_presets.count(); ++i) - { - delete m_presets[i]; - } - - for (int i = 0; i < m_commands.count(); ++i) - { - delete m_commands[i]; - } - - for (int i = 0; i < m_featureSetPresets.count(); ++i) - { - delete m_featureSetPresets[i]; - } - for (int i = 0; i < m_pluginPresets.count(); ++i) - { - delete m_pluginPresets[i]; - } - - for (int i = 0; i < m_configurations.count(); ++i) - { - delete m_configurations[i]; - } + qDeleteAll(m_presets); + qDeleteAll(m_commands); + qDeleteAll(m_featureSetPresets); + qDeleteAll(m_pluginPresets); + qDeleteAll(m_configurations); } QString MainSettings::getFileLocation() const From 671438456ce9d66754fb459ac428a1411c066c05 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sat, 4 May 2024 14:05:56 +0200 Subject: [PATCH 11/16] Fix memleaks found with AddressSanitizer/LeakSanitizer Found with: ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel Fixes: Direct leak of 32 byte(s) in 1 object(s) allocated from: #0 0x7f2360af46b8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7f2321a07706 in AFC::MsgDeviceSetListsReport::create() sdrangel/plugins/feature/afc/afc.h:151 #2 0x7f2321a0ac1f in AFC::updateDeviceSetLists() sdrangel/plugins/feature/afc/afc.cpp:290 #3 0x7f2321a09648 in AFC::handleMessage(Message const&) sdrangel/plugins/feature/afc/afc.cpp:214 #4 0x7f235dfba569 in Feature::handleInputMessages() sdrangel/sdrbase/feature/feature.cpp:46 #5 0x7f235ddea09e in Feature::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) build-sdrangel-Desktop_qt5-Debug/sdrbase/sdrbase_autogen/3DM3QXXG3A/moc_feature.cpp:89 #6 0x7f235b305fcc (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x305fcc) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e) #7 0x7f235ddf5d8c in MessageQueue::messageEnqueued() build-sdrangel-Desktop_qt5-Debug/sdrbase/sdrbase_autogen/KH43KSYMFX/moc_messagequeue.cpp:131 #8 0x7f235e0e1487 in MessageQueue::push(Message*, bool) sdrangel/sdrbase/util/messagequeue.cpp:55 #9 0x7f2321a32fad in AFCGUI::requestDeviceSetLists() sdrangel/plugins/feature/afc/afcgui.cpp:213 #10 0x7f2321a32124 in AFCGUI::AFCGUI(PluginAPI*, FeatureUISet*, Feature*, QWidget*) sdrangel/plugins/feature/afc/afcgui.cpp:170 #11 0x7f2321a308cc in AFCGUI::create(PluginAPI*, FeatureUISet*, Feature*) sdrangel/plugins/feature/afc/afcgui.cpp:32 #12 0x7f2321a1c229 in AFCPlugin::createFeatureGUI(FeatureUISet*, Feature*) const sdrangel/plugins/feature/afc/afcplugin.cpp:70 #13 0x7f235fffc534 in MainWindow::featureAddClicked(Workspace*, int) sdrangel/sdrgui/mainwindow.cpp:2890 #14 0x7f23600172c1 in QtPrivate::FunctorCall, QtPrivate::List, void, void (MainWindow::*)(Workspace*, int)>::call(void (MainWindow::*)(Workspace*, int), MainWindow*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:152 #15 0x7f2360012b8d in void QtPrivate::FunctionPointer::call, void>(void (MainWindow::*)(Workspace*, int), MainWindow*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:185 #16 0x7f2360010016 in QtPrivate::QSlotObject, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:418 #17 0x7f235b3062b1 (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x3062b1) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e) #18 0x7f235ffcc7fc in Workspace::addFeature(Workspace*, int) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_workspace.cpp:393 #19 0x7f23602f56f8 in Workspace::addFeatureEmitted(int) sdrangel/sdrgui/gui/workspace.cpp:413 #20 0x7f236030d611 in QtPrivate::FunctorCall, QtPrivate::List, void, void (Workspace::*)(int)>::call(void (Workspace::*)(int), Workspace*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:152 #21 0x7f2360308bd9 in void QtPrivate::FunctionPointer::call, void>(void (Workspace::*)(int), Workspace*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:185 #22 0x7f2360305cdc in QtPrivate::QSlotObject, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:418 #23 0x7f235b3062b1 (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x3062b1) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e) #24 0x7f235ffba7cf in FeatureAddDialog::addFeature(int) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_featureadddialog.cpp:141 #25 0x7f23600c2d19 in FeatureAddDialog::apply(QAbstractButton*) sdrangel/sdrgui/gui/featureadddialog.cpp:53 #26 0x7f235ffba366 in FeatureAddDialog::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_featureadddialog.cpp:82 #27 0x7f235b305fcc (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x305fcc) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e) #28 0x7f235c1029b2 in QDialogButtonBox::clicked(QAbstractButton*) (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x3029b2) (BuildId: dfefd27f084c0dd066215fc79825fceae604f481) --- plugins/feature/afc/afcgui.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/feature/afc/afcgui.cpp b/plugins/feature/afc/afcgui.cpp index 0108852f04..e855d605cb 100644 --- a/plugins/feature/afc/afcgui.cpp +++ b/plugins/feature/afc/afcgui.cpp @@ -103,6 +103,7 @@ bool AFCGUI::handleMessage(const Message& message) { const AFC::MsgDeviceSetListsReport& report = (AFC::MsgDeviceSetListsReport&) message; updateDeviceSetLists(report); + return true; } return false; From 8829df3c3bb053bb97ec9d63f041fd083750c5db Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sat, 4 May 2024 17:17:24 +0200 Subject: [PATCH 12/16] Fix memleaks found with AddressSanitizer/LeakSanitizer Found with: ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel Fixes: Direct leak of 448 byte(s) in 2 object(s) allocated from: #0 0x7f78cd8f46b8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7f788e0e9d9c in GS232ControllerWorker::MsgConfigureGS232ControllerWorker::create(GS232ControllerSettings const&, QList const&, bool) sdrangel/plugins/feature/gs232controller/gs232controllerworker.h:51 #2 0x7f788e0eeedf in GS232Controller::applySettings(GS232ControllerSettings const&, QList const&, bool) sdrangel/plugins/feature/gs232controller/gs232controller.cpp:291 #3 0x7f788e0ec595 in GS232Controller::handleMessage(Message const&) sdrangel/plugins/feature/gs232controller/gs232controller.cpp:156 #4 0x7f78cabe899f in Feature::handleInputMessages() sdrangel/sdrbase/feature/feature.cpp:46 #5 0x7f78ca9f9b5c in Feature::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) build-sdrangel-Desktop_qt5-Debug/sdrbase/sdrbase_autogen/3DM3QXXG3A/moc_feature.cpp:89 #6 0x7f78c7f05fcc (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x305fcc) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e) #7 0x7f78caa0584a in MessageQueue::messageEnqueued() build-sdrangel-Desktop_qt5-Debug/sdrbase/sdrbase_autogen/KH43KSYMFX/moc_messagequeue.cpp:131 #8 0x7f78cad19c77 in MessageQueue::push(Message*, bool) sdrangel/sdrbase/util/messagequeue.cpp:55 #9 0x7f788e142936 in GS232ControllerGUI::applySettings(QStringList const&, bool) sdrangel/plugins/feature/gs232controller/gs232controllergui.cpp:969 #10 0x7f788e142727 in GS232ControllerGUI::applySetting(QString const&) sdrangel/plugins/feature/gs232controller/gs232controllergui.cpp:960 #11 0x7f788e133c26 in GS232ControllerGUI::onWidgetRolled(QWidget*, bool) sdrangel/plugins/feature/gs232controller/gs232controllergui.cpp:206 #12 0x7f788e0e25d9 in GS232ControllerGUI::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) build-sdrangel-Desktop_qt5-Debug/plugins/feature/gs232controller/featuregs232controller_autogen/EWIEGA46WW/moc_gs232controllergui.cpp:234 #13 0x7f78c7f05fcc (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x305fcc) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e) #14 0x7f78ccdcd9a1 in RollupContents::widgetRolled(QWidget*, bool) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_rollupcontents.cpp:146 #15 0x7f78cd06a080 in RollupContents::eventFilter(QObject*, QEvent*) sdrangel/sdrgui/gui/rollupcontents.cpp:403 #16 0x7f78c7ecc4b2 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2cc4b2) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e) and more --- plugins/feature/gs232controller/gs232controller.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/feature/gs232controller/gs232controller.cpp b/plugins/feature/gs232controller/gs232controller.cpp index 27e02c5b6c..52a2298c34 100644 --- a/plugins/feature/gs232controller/gs232controller.cpp +++ b/plugins/feature/gs232controller/gs232controller.cpp @@ -288,11 +288,10 @@ void GS232Controller::applySettings(const GS232ControllerSettings& settings, con m_selectedPipe = m_availableChannelOrFeatureHandler.registerPipes(settings.m_source, {"target"}); } - GS232ControllerWorker::MsgConfigureGS232ControllerWorker *msg = GS232ControllerWorker::MsgConfigureGS232ControllerWorker::create( - settings, settingsKeys, force - ); - if (m_worker) { + GS232ControllerWorker::MsgConfigureGS232ControllerWorker *msg = GS232ControllerWorker::MsgConfigureGS232ControllerWorker::create( + settings, settingsKeys, force + ); m_worker->getInputMessageQueue()->push(msg); } From 461a79439bdfe9025ee99c2557423d57d2b992af Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sat, 4 May 2024 17:42:40 +0200 Subject: [PATCH 13/16] Do not create a Message if there is no worker to send to Prevents memory leaks. --- plugins/feature/pertester/pertester.cpp | 6 +++--- plugins/feature/satellitetracker/satellitetracker.cpp | 7 +++---- plugins/feature/startracker/startracker.cpp | 10 +++++----- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/plugins/feature/pertester/pertester.cpp b/plugins/feature/pertester/pertester.cpp index 6b4b422a67..6a5316b07d 100644 --- a/plugins/feature/pertester/pertester.cpp +++ b/plugins/feature/pertester/pertester.cpp @@ -189,10 +189,10 @@ void PERTester::applySettings(const PERTesterSettings& settings, const QListgetInputMessageQueue()->push(msg); } diff --git a/plugins/feature/satellitetracker/satellitetracker.cpp b/plugins/feature/satellitetracker/satellitetracker.cpp index e64b6a848c..ce8540dd14 100644 --- a/plugins/feature/satellitetracker/satellitetracker.cpp +++ b/plugins/feature/satellitetracker/satellitetracker.cpp @@ -208,11 +208,10 @@ void SatelliteTracker::applySettings(const SatelliteTrackerSettings& settings, c tlesChanged = true; } - SatelliteTrackerWorker::MsgConfigureSatelliteTrackerWorker *msg = SatelliteTrackerWorker::MsgConfigureSatelliteTrackerWorker::create( - settings, settingsKeys, force - ); - if (m_worker) { + SatelliteTrackerWorker::MsgConfigureSatelliteTrackerWorker *msg = SatelliteTrackerWorker::MsgConfigureSatelliteTrackerWorker::create( + settings, settingsKeys, force + ); m_worker->getInputMessageQueue()->push(msg); } diff --git a/plugins/feature/startracker/startracker.cpp b/plugins/feature/startracker/startracker.cpp index c656cb2b05..bd8185abe9 100644 --- a/plugins/feature/startracker/startracker.cpp +++ b/plugins/feature/startracker/startracker.cpp @@ -163,9 +163,9 @@ bool StarTracker::handleMessage(const Message& cmd) } else if (MsgSetSolarFlux::match(cmd)) { - MsgSetSolarFlux& msg = (MsgSetSolarFlux&) cmd; - m_solarFlux = msg.getFlux(); if (m_worker) { + MsgSetSolarFlux& msg = (MsgSetSolarFlux&) cmd; + m_solarFlux = msg.getFlux(); m_worker->getInputMessageQueue()->push(new MsgSetSolarFlux(msg)); } return true; @@ -246,10 +246,10 @@ void StarTracker::applySettings(const StarTrackerSettings& settings, const QList } } - StarTrackerWorker::MsgConfigureStarTrackerWorker *msg = StarTrackerWorker::MsgConfigureStarTrackerWorker::create( - settings, settingsKeys, force - ); if (m_worker) { + StarTrackerWorker::MsgConfigureStarTrackerWorker *msg = StarTrackerWorker::MsgConfigureStarTrackerWorker::create( + settings, settingsKeys, force + ); m_worker->getInputMessageQueue()->push(msg); } From 3c0541d87a3c9c3c40339c2db934f20cbe94eb20 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sat, 4 May 2024 17:46:12 +0200 Subject: [PATCH 14/16] Do not create objects if there is no message queue to send to Prevents memory leaks. --- plugins/feature/startracker/startracker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/feature/startracker/startracker.cpp b/plugins/feature/startracker/startracker.cpp index bd8185abe9..2f2b258d45 100644 --- a/plugins/feature/startracker/startracker.cpp +++ b/plugins/feature/startracker/startracker.cpp @@ -172,16 +172,16 @@ bool StarTracker::handleMessage(const Message& cmd) } else if (MainCore::MsgStarTrackerDisplaySettings::match(cmd)) { - MainCore::MsgStarTrackerDisplaySettings& settings = (MainCore::MsgStarTrackerDisplaySettings&) cmd; if (m_guiMessageQueue) { + MainCore::MsgStarTrackerDisplaySettings& settings = (MainCore::MsgStarTrackerDisplaySettings&) cmd; m_guiMessageQueue->push(new MainCore::MsgStarTrackerDisplaySettings(settings)); } return true; } else if (MainCore::MsgStarTrackerDisplayLoSSettings::match(cmd)) { - MainCore::MsgStarTrackerDisplayLoSSettings& settings = (MainCore::MsgStarTrackerDisplayLoSSettings&) cmd; if (m_guiMessageQueue) { + MainCore::MsgStarTrackerDisplayLoSSettings& settings = (MainCore::MsgStarTrackerDisplayLoSSettings&) cmd; m_guiMessageQueue->push(new MainCore::MsgStarTrackerDisplayLoSSettings(settings)); } return true; From b79b7749696d309b079ed78d308c83f0b84c9d46 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sat, 4 May 2024 18:00:01 +0200 Subject: [PATCH 15/16] Fix memleaks found with AddressSanitizer/LeakSanitizer Found with: ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel Fixes: Direct leak of 16 byte(s) in 1 object(s) allocated from: #0 0x7f3c3e0f46b8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7f3bfdef913c in WebServer::WebServer(unsigned short&, QObject*) sdrangel/plugins/feature/skymap/webserver.cpp:34 #2 0x7f3bfdf10b56 in SkyMapGUI::SkyMapGUI(PluginAPI*, FeatureUISet*, Feature*, QWidget*) sdrangel/plugins/feature/skymap/skymapgui.cpp:220 #3 0x7f3bfdf0eb20 in SkyMapGUI::create(PluginAPI*, FeatureUISet*, Feature*) sdrangel/plugins/feature/skymap/skymapgui.cpp:44 #4 0x7f3bfdef75e9 in SkyMapPlugin::createFeatureGUI(FeatureUISet*, Feature*) const sdrangel/plugins/feature/skymap/skymapplugin.cpp:72 #5 0x7f3c3d60938b in MainWindow::featureAddClicked(Workspace*, int) sdrangel/sdrgui/mainwindow.cpp:2888 #6 0x7f3c3d624621 in QtPrivate::FunctorCall, QtPrivate::List, void, void (MainWindow::*)(Workspace*, int)>::call(void (MainWindow::*)(Workspace*, int), MainWindow*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:152 #7 0x7f3c3d61feed in void QtPrivate::FunctionPointer::call, void>(void (MainWindow::*)(Workspace*, int), MainWindow*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:185 #8 0x7f3c3d61d376 in QtPrivate::QSlotObject, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:418 #9 0x7f3c387062b1 (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x3062b1) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e) #10 0x7f3c3d5d5ca4 in Workspace::addFeature(Workspace*, int) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_workspace.cpp:393 #11 0x7f3c3d90c6a2 in Workspace::addFeatureEmitted(int) sdrangel/sdrgui/gui/workspace.cpp:413 #12 0x7f3c3d9245bb in QtPrivate::FunctorCall, QtPrivate::List, void, void (Workspace::*)(int)>::call(void (Workspace::*)(int), Workspace*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:152 #13 0x7f3c3d91fb83 in void QtPrivate::FunctionPointer::call, void>(void (Workspace::*)(int), Workspace*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:185 #14 0x7f3c3d91cc86 in QtPrivate::QSlotObject, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:418 #15 0x7f3c387062b1 (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x3062b1) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e) #16 0x7f3c3d5c3c77 in FeatureAddDialog::addFeature(int) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_featureadddialog.cpp:141 #17 0x7f3c3d6d0d79 in FeatureAddDialog::apply(QAbstractButton*) sdrangel/sdrgui/gui/featureadddialog.cpp:53 #18 0x7f3c3d5c380e in FeatureAddDialog::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_featureadddialog.cpp:82 #19 0x7f3c38705fcc (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x305fcc) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e) #20 0x7f3c395029b2 in QDialogButtonBox::clicked(QAbstractButton*) (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x3029b2) (BuildId: dfefd27f084c0dd066215fc79825fceae604f481) and more --- plugins/feature/skymap/webserver.cpp | 5 +++++ plugins/feature/skymap/webserver.h | 1 + 2 files changed, 6 insertions(+) diff --git a/plugins/feature/skymap/webserver.cpp b/plugins/feature/skymap/webserver.cpp index 23dc85e7be..50403fb508 100644 --- a/plugins/feature/skymap/webserver.cpp +++ b/plugins/feature/skymap/webserver.cpp @@ -41,6 +41,11 @@ WebServer::WebServer(quint16 &port, QObject* parent) : m_mimeTypes.insert(".geojson", new MimeType("application/geo+json")); } +WebServer::~WebServer() +{ + qDeleteAll(m_mimeTypes); +} + void WebServer::incomingConnection(qintptr socket) { QTcpSocket* s = new QTcpSocket(this); diff --git a/plugins/feature/skymap/webserver.h b/plugins/feature/skymap/webserver.h index da3e034b3d..292078e352 100644 --- a/plugins/feature/skymap/webserver.h +++ b/plugins/feature/skymap/webserver.h @@ -64,6 +64,7 @@ class WebServer : public QTcpServer public: WebServer(quint16 &port, QObject* parent = 0); + ~WebServer(); void incomingConnection(qintptr socket) override; void addPathSubstitution(const QString &from, const QString &to); void addSubstitution(QString path, QString from, QString to); From 0ae44663e1540c207a3aa43c99ba81a92d1ae6e7 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sat, 4 May 2024 18:02:32 +0200 Subject: [PATCH 16/16] Fix memleaks found with AddressSanitizer/LeakSanitizer Found with: ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel Fixes: Direct leak of 8 byte(s) in 1 object(s) allocated from: #0 0x7fabe9cf46b8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7faba9afa508 in WebServer::addSubstitution(QString, QString, QString) sdrangel/plugins/feature/skymap/webserver.cpp:83 #2 0x7faba9b11591 in SkyMapGUI::SkyMapGUI(PluginAPI*, FeatureUISet*, Feature*, QWidget*) sdrangel/plugins/feature/skymap/skymapgui.cpp:224 #3 0x7faba9b0f0a0 in SkyMapGUI::create(PluginAPI*, FeatureUISet*, Feature*) sdrangel/plugins/feature/skymap/skymapgui.cpp:44 #4 0x7faba9af70e9 in SkyMapPlugin::createFeatureGUI(FeatureUISet*, Feature*) const sdrangel/plugins/feature/skymap/skymapplugin.cpp:72 #5 0x7fabe920938b in MainWindow::featureAddClicked(Workspace*, int) sdrangel/sdrgui/mainwindow.cpp:2888 #6 0x7fabe9224621 in QtPrivate::FunctorCall, QtPrivate::List, void, void (MainWindow::*)(Workspace*, int)>::call(void (MainWindow::*)(Workspace*, int), MainWindow*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:152 #7 0x7fabe921feed in void QtPrivate::FunctionPointer::call, void>(void (MainWindow::*)(Workspace*, int), MainWindow*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:185 #8 0x7fabe921d376 in QtPrivate::QSlotObject, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:418 #9 0x7fabe43062b1 (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x3062b1) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e) #10 0x7fabe91d5ca4 in Workspace::addFeature(Workspace*, int) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_workspace.cpp:393 #11 0x7fabe950c6a2 in Workspace::addFeatureEmitted(int) sdrangel/sdrgui/gui/workspace.cpp:413 #12 0x7fabe95245bb in QtPrivate::FunctorCall, QtPrivate::List, void, void (Workspace::*)(int)>::call(void (Workspace::*)(int), Workspace*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:152 #13 0x7fabe951fb83 in void QtPrivate::FunctionPointer::call, void>(void (Workspace::*)(int), Workspace*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:185 #14 0x7fabe951cc86 in QtPrivate::QSlotObject, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:418 #15 0x7fabe43062b1 (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x3062b1) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e) #16 0x7fabe91c3c77 in FeatureAddDialog::addFeature(int) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_featureadddialog.cpp:141 #17 0x7fabe92d0d79 in FeatureAddDialog::apply(QAbstractButton*) sdrangel/sdrgui/gui/featureadddialog.cpp:53 #18 0x7fabe91c380e in FeatureAddDialog::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_featureadddialog.cpp:82 #19 0x7fabe4305fcc (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x305fcc) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e) #20 0x7fabe51029b2 in QDialogButtonBox::clicked(QAbstractButton*) (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x3029b2) (BuildId: dfefd27f084c0dd066215fc79825fceae604f481) and more --- plugins/feature/skymap/webserver.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/feature/skymap/webserver.cpp b/plugins/feature/skymap/webserver.cpp index 50403fb508..8de3099e6e 100644 --- a/plugins/feature/skymap/webserver.cpp +++ b/plugins/feature/skymap/webserver.cpp @@ -43,6 +43,7 @@ WebServer::WebServer(quint16 &port, QObject* parent) : WebServer::~WebServer() { + qDeleteAll(m_substitutions); qDeleteAll(m_mimeTypes); }