Commit d5803676 authored by David Edmundson's avatar David Edmundson

Fix memory leak of PanelViews on shutdown

The current code is broken as the course of events is:
 - we delete the containment
- an existing connect to containment deleted goes to
panelContainmentDestroyed
 - this updates m_panelViews and calls deleteLater
 - this deleteLater isn't run before other exit handlers
parent fcdbbda3
......@@ -252,11 +252,10 @@ ShellCorona::ShellCorona(QObject *parent)
ShellCorona::~ShellCorona()
{
while (!containments().isEmpty()) {
//deleting a containment will remove it from the list due to QObject::destroyed connect in Corona
// Deleting a containment will remove it from the list due to QObject::destroyed connect in Corona
// Deleting a containment in turn also kills any panel views
delete containments().first();
}
qDeleteAll(m_panelViews);
m_panelViews.clear();
}
KPackage::Package ShellCorona::lookAndFeelPackage()
......@@ -1381,7 +1380,7 @@ void ShellCorona::createWaitingPanels()
void ShellCorona::panelContainmentDestroyed(QObject *cont)
{
auto view = m_panelViews.take(static_cast<Plasma::Containment*>(cont));
view->deleteLater();
delete view;
//don't make things relayout when the application is quitting
//NOTE: qApp->closingDown() is still false here
if (!m_closingDown) {
......
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