Fix memleaks found with AddressSanitizer/LeakSanitizer

Found with:
ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel

Fixes:
Indirect leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x7faba78f46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
    #1 0x7fab69d3817f in RadiosondeGUI::RadiosondeGUI(PluginAPI*, FeatureUISet*, Feature*, QWidget*) plugins/feature/radiosonde/radiosondegui.cpp:189
    #2 0x7fab69d39814 in RadiosondeGUI::create(PluginAPI*, FeatureUISet*, Feature*) plugins/feature/radiosonde/radiosondegui.cpp:43
    #3 0x7faba752c578 in FeatureUISet::loadFeatureSetSettings(FeatureSetPreset const*, PluginAPI*, WebAPIAdapterInterface*, QList<Workspace*>*, Workspace*) sdrgui/feature/featureuiset.cpp:185
    #4 0x7faba717dbe8 in MainWindow::loadConfiguration(Configuration const*, bool) sdrgui/mainwindow.cpp:1507
    #5 0x7faba715a610 in MainWindow::MainWindow(qtwebapp::LoggerWithFile*, MainParser const&, QWidget*) sdrgui/mainwindow.cpp:261
    #6 0x5630df43f175 in runQtApplication app/main.cpp:196
    #7 0x5630df43cab7 in main app/main.cpp:248
    #8 0x7faba1e456c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

and 7 others that I'm not copying here.
Daniele Forsi 2024-04-06 22:05:22 +02:00
rodzic 0077b0af7e
commit 945a2fc91c
1 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -203,6 +203,14 @@ RadiosondeGUI::~RadiosondeGUI()
{
// Remove from map and free memory
on_deleteAll_clicked();
delete ui->radiosondes->itemDelegateForColumn(RADIOSONDE_COL_LATITUDE);
delete ui->radiosondes->itemDelegateForColumn(RADIOSONDE_COL_LONGITUDE);
delete ui->radiosondes->itemDelegateForColumn(RADIOSONDE_COL_ALTITUDE);
delete ui->radiosondes->itemDelegateForColumn(RADIOSONDE_COL_SPEED);
delete ui->radiosondes->itemDelegateForColumn(RADIOSONDE_COL_VERTICAL_RATE);
delete ui->radiosondes->itemDelegateForColumn(RADIOSONDE_COL_HEADING);
delete ui->radiosondes->itemDelegateForColumn(RADIOSONDE_COL_ALT_MAX);
delete ui->radiosondes->itemDelegateForColumn(RADIOSONDE_COL_LAST_UPDATE);
delete ui;
}