Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit e2ba40a4 authored by Kevin Funk's avatar Kevin Funk

Fix a few memory leaks

ASAN: Fix leak in XWindowTasksModel

Summary:
Trace:
Direct leak of 24 byte(s) in 3 object(s) allocated from:
    #0 0x544cc0 in operator new(unsigned long) (/home/kfunk/devel/install/kf5/bin/plasmashell+0x544cc0)
    #1 0x7fe4f0e82df9 in TaskManager::XWindowTasksModel::Private::windowInfo(unsigned long long) /home/kfunk/devel/src/kf5/plasma-workspace/libtaskmanager/xwindowtasksmodel.cpp:419:25
    #2 0x7fe4f0e87e69 in TaskManager::XWindowTasksModel::data(QModelIndex const&, int) const /home/kfunk/devel/src/kf5/plasma-workspace/libtaskmanager/xwindowtasksmodel.cpp:646:38
    ...

ASAN: Fix leak in ShellCorona

Trace:
Indirect leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x544cc0 in operator new(unsigned long) (/home/kfunk/devel/install/kf5/bin/plasmashell+0x544cc0)
    #1 0x5e1a95 in ShellCorona::checkAddPanelAction(QStringList const&) /home/kfunk/devel/src/kf5/plasma-workspace/shell/shellcorona.cpp:1728:27
    #2 0x5dac7e in ShellCorona::ShellCorona(QObject*) /home/kfunk/devel/src/kf5/plasma-workspace/shell/shellcorona.cpp:180:5
    #3 0x65c31d in ShellManager::loadHandlers() /home/kfunk/devel/src/kf5/plasma-workspace/shell/shellmanager.cpp:93:21
    ...

Reviewers: davidedmundson

Reviewed By: davidedmundson

Subscribers: davidedmundson, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D17032
parent 38a50ce7
......@@ -1709,8 +1709,7 @@ void ShellCorona::checkAddPanelAction(const QStringList &sycocaChanges)
delete m_addPanelAction;
m_addPanelAction = nullptr;
delete m_addPanelsMenu;
m_addPanelsMenu = nullptr;
m_addPanelsMenu.reset(nullptr);
KPluginInfo::List panelContainmentPlugins = Plasma::PluginLoader::listContainmentsOfType(QStringLiteral("Panel"));
......@@ -1725,12 +1724,12 @@ void ShellCorona::checkAddPanelAction(const QStringList &sycocaChanges)
m_addPanelAction->setData(Plasma::Types::AddAction);
connect(m_addPanelAction, SIGNAL(triggered(bool)), this, SLOT(addPanel()));
} else if (!panelContainmentPlugins.isEmpty()) {
m_addPanelsMenu = new QMenu;
m_addPanelsMenu.reset(new QMenu);
m_addPanelAction = m_addPanelsMenu->menuAction();
m_addPanelAction->setText(i18n("Add Panel"));
m_addPanelAction->setData(Plasma::Types::AddAction);
connect(m_addPanelsMenu, &QMenu::aboutToShow, this, &ShellCorona::populateAddPanelsMenu);
connect(m_addPanelsMenu, SIGNAL(triggered(QAction*)), this, SLOT(addPanel(QAction*)));
connect(m_addPanelsMenu.data(), &QMenu::aboutToShow, this, &ShellCorona::populateAddPanelsMenu);
connect(m_addPanelsMenu.data(), SIGNAL(triggered(QAction*)), this, SLOT(addPanel(QAction*)));
}
if (m_addPanelAction) {
......
......@@ -25,6 +25,7 @@
#include "plasma/corona.h"
#include <QScopedPointer>
#include <QSet>
#include <QTimer>
#include <QDBusVariant>
......@@ -238,7 +239,7 @@ private:
QList<Plasma::Containment *> m_waitingPanels;
QHash<QString, QString> m_activityContainmentPlugins;
QAction *m_addPanelAction;
QMenu *m_addPanelsMenu;
QScopedPointer<QMenu> m_addPanelsMenu;
KPackage::Package m_lookAndFeelPackage;
QSet<QScreen*> m_redundantOutputs;
KDeclarative::QmlObjectSharedEngine *m_interactiveConsole;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment