qt: fix a couple of leaks in expert prefs
Identified by a different invocation of ASAN than I'd previously used. wrt. the second fix it seems `clear()` alone does not destroy these items. ``` Direct leak of 64560 byte(s) in 1345 object(s) allocated from: #0 0x7f1f87268f37 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99 #1 0x7f1f71099981 in ExpertPrefsTableModel::ExpertPrefsTableModel(module_t**, unsigned long, QWidget*) ../../modules/gui/qt/dialogs/preferences/expert_model.cpp:260 #2 0x7f1f710a32fa in PrefsDialog::setExpert() ../../modules/gui/qt/dialogs/preferences/preferences.cpp:106 #3 0x7f1f710a8851 in PrefsDialog::PrefsDialog(QWindow*, qt_intf_t*) ../../modules/gui/qt/dialogs/preferences/preferences.cpp:74 #4 0x7f1f70ee43e2 in DialogsProvider::prefsDialog() ../../modules/gui/qt/dialogs/dialogs_provider.cpp:253 #5 0x7f1f714f6f97 in DialogsProvider::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) gui/qt/dialogs/dialogs_provider.moc.cpp:268 #6 0x7f1f714f7c11 in DialogsProvider::qt_metacall(QMetaObject::Call, int, void**) gui/qt/dialogs/dialogs_provider.moc.cpp:388 #7 0x7f1f70568f1c (/lib/x86_64-linux-gnu/libQt5Qml.so.5+0x2c4f1c) ... Direct leak of 1112 byte(s) in 122 object(s) allocated from: #0 0x7f1f872127a7 in __interceptor_strdup ../../../../src/libsanitizer/asan/asan_interceptors.cpp:454 #1 0x7f1f710950f0 in ExpertPrefsTableItem::ExpertPrefsTableItem(module_config_t*, QString const&, QString const&, bool) ../../modules/gui/qt/dialogs/preferences/expert_model.cpp:61 #2 0x7f1f710999ac in ExpertPrefsTableModel::ExpertPrefsTableModel(module_t**, unsigned long, QWidget*) ../../modules/gui/qt/dialogs/preferences/expert_model.cpp:260 #3 0x7f1f710a32fa in PrefsDialog::setExpert() ../../modules/gui/qt/dialogs/preferences/preferences.cpp:106 #4 0x7f1f710a8851 in PrefsDialog::PrefsDialog(QWindow*, qt_intf_t*) ../../modules/gui/qt/dialogs/preferences/preferences.cpp:74 #5 0x7f1f70ee43e2 in DialogsProvider::prefsDialog() ../../modules/gui/qt/dialogs/dialogs_provider.cpp:253 #6 0x7f1f714f6f97 in DialogsProvider::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) gui/qt/dialogs/dialogs_provider.moc.cpp:268 #7 0x7f1f714f7c11 in DialogsProvider::qt_metacall(QMetaObject::Call, int, void**) gui/qt/dialogs/dialogs_provider.moc.cpp:388 #8 0x7f1f70568f1c (/lib/x86_64-linux-gnu/libQt5Qml.so.5+0x2c4f1c) ... Direct leak of 33 byte(s) in 33 object(s) allocated from: #0 0x7f1f872677cf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x7f1f86eac342 in vlc_alloc ../../include/vlc_common.h:1149 #2 0x7f1f86eac342 in module_config_get ../../src/modules/modules.c:346 #3 0x7f1f710995f5 in ExpertPrefsTableModel::ExpertPrefsTableModel(module_t**, unsigned long, QWidget*) ../../modules/gui/qt/dialogs/preferences/expert_model.cpp:230 #4 0x7f1f710a32fa in PrefsDialog::setExpert() ../../modules/gui/qt/dialogs/preferences/preferences.cpp:106 #5 0x7f1f710a8851 in PrefsDialog::PrefsDialog(QWindow*, qt_intf_t*) ../../modules/gui/qt/dialogs/preferences/preferences.cpp:74 #6 0x7f1f70ee43e2 in DialogsProvider::prefsDialog() ../../modules/gui/qt/dialogs/dialogs_provider.cpp:253 #7 0x7f1f714f6f97 in DialogsProvider::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) gui/qt/dialogs/dialogs_provider.moc.cpp:268 #8 0x7f1f714f7c11 in DialogsProvider::qt_metacall(QMetaObject::Call, int, void**) gui/qt/dialogs/dialogs_provider.moc.cpp:388 #9 0x7f1f70568f1c (/lib/x86_64-linux-gnu/libQt5Qml.so.5+0x2c4f1c) ```
Please register or sign in to comment