panels: fixed bug that added panel to list twice and led to double-free
This commit is contained in:
@@ -35,12 +35,10 @@ PanelManager::PanelManager(QObject *parent) :
|
||||
|
||||
void PanelManager::DeleteAllPanels()
|
||||
{
|
||||
foreach (PanelWidget* panel, focus_history_) {
|
||||
// We don't need to run this signal anymore since we're destroying and clearing everything
|
||||
disconnect(panel, &PanelWidget::destroyed, this, &PanelManager::PanelDestroyed);
|
||||
delete panel;
|
||||
}
|
||||
// Prevent any confusion regarding focus history by clearing it first
|
||||
QList<PanelWidget*> copy = focus_history_;
|
||||
focus_history_.clear();
|
||||
qDeleteAll(copy);
|
||||
}
|
||||
|
||||
const QList<PanelWidget *> &PanelManager::panels()
|
||||
|
||||
Reference in New Issue
Block a user