Skip to content

Fix leak in kategdbplugin

Waqar Ahmed requested to merge work/gdbplugin-leak into master

IOView was leaking because it had no parent. It is now managed via a unique_ptr

Two other manually deleted objects are also now managed via unique_ptr.

Backtrace

    #0 0x55b67b1bcc79 in operator new(unsigned long) (/home/waqar/kde/src/utilities/kate/build/bin/kate+0x16ac79)
    #1 0x7fdd59cd0cb0 in IOView::createFifos() /home/waqar/kde/src/utilities/kate/addons/gdbplugin/ioview.cpp:100:24
    #2 0x7fdd59ccffb6 in IOView::IOView(QWidget*) /home/waqar/kde/src/utilities/kate/addons/gdbplugin/ioview.cpp:57:5
    #3 0x7fdd59c5c6ce in KatePluginGDBView::KatePluginGDBView(KTextEditor::Plugin*, KTextEditor::MainWindow*) /home/waqar/kde/src/utilities/kate/addons/gdbplugin/plugin_kategdb.cpp:147:20
    #4 0x7fdd59c58fe8 in KatePluginGDB::createView(KTextEditor::MainWindow*) /home/waqar/kde/src/utilities/kate/addons/gdbplugin/plugin_kategdb.cpp:55:16
    #5 0x55b67b2a7b83 in KatePluginManager::enablePluginGUI(KatePluginInfo*, KateMainWindow*, KConfigBase*) /home/waqar/kde/src/utilities/kate/kate/katepluginmanager.cpp:233:37
    #6 0x55b67b2a759b in KatePluginManager::enableAllPluginsGUI(KateMainWindow*, KConfigBase*) /home/waqar/kde/src/utilities/kate/kate/katepluginmanager.cpp:172:13
    #7 0x55b67b21fe5a in KateMainWindow::KateMainWindow(KConfig*, QString const&) /home/waqar/kde/src/utilities/kate/kate/katemainwindow.cpp:138:39
    #8 0x55b67b1e7173 in KateApp::newMainWindow(KConfig*, QString const&) /home/waqar/kde/src/utilities/kate/kate/kateapp.cpp:431:38
    #9 0x55b67b39a56d in KateSessionManager::loadSession(QExplicitlySharedDataPointer<KateSession> const&) const /home/waqar/kde/src/utilities/kate/kate/session/katesessionmanager.cpp:195:34
    #10 0x55b67b399145 in KateSessionManager::activateSession(QExplicitlySharedDataPointer<KateSession>, bool, bool) /home/waqar/kde/src/utilities/kate/kate/session/katesessionmanager.cpp:156:9
    #11 0x55b67b39b70d in KateSessionManager::activateSession(QString const&, bool, bool) /home/waqar/kde/src/utilities/kate/kate/session/katesessionmanager.cpp:232:12
    #12 0x55b67b39bb70 in KateSessionManager::activateAnonymousSession() /home/waqar/kde/src/utilities/kate/kate/session/katesessionmanager.cpp:237:12
    #13 0x55b67b3a01e0 in KateSessionManager::chooseSession() /home/waqar/kde/src/utilities/kate/kate/session/katesessionmanager.cpp:416:16
    #14 0x55b67b1e5e5e in KateApp::startupKate() /home/waqar/kde/src/utilities/kate/kate/kateapp.cpp:176:32
    #15 0x55b67b1e4e1b in KateApp::init() /home/waqar/kde/src/utilities/kate/kate/kateapp.cpp:133:14
    #16 0x55b67b1ca482 in main /home/waqar/kde/src/utilities/kate/kate/main.cpp:677:18
    #17 0x7fdd64db9b24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24)

Signed-off-by: Waqar Ahmed waqar.17a@gmail.com

Edited by Waqar Ahmed

Merge request reports

Loading