From 232bcc04c94bdf7e9bf16ae27b609730626e70cb Mon Sep 17 00:00:00 2001 From: staticfox Date: Thu, 21 Apr 2016 13:29:23 -0400 Subject: PopupEditorWindow: Fix crash in context removal --- src/modules/popupeditor/PopupEditorWindow.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/modules') diff --git a/src/modules/popupeditor/PopupEditorWindow.cpp b/src/modules/popupeditor/PopupEditorWindow.cpp index 5f20c64df..feedfddac 100644 --- a/src/modules/popupeditor/PopupEditorWindow.cpp +++ b/src/modules/popupeditor/PopupEditorWindow.cpp @@ -1254,9 +1254,11 @@ void PopupEditorWidget::removeCurrentPopup() { if(m_pLastEditedItem) { - delete m_pLastEditedItem; + MenuTreeWidgetItem * it = m_pLastEditedItem; m_pLastEditedItem = nullptr; - currentItemChanged(0,0); + delete it; + if(!m_pLastEditedItem) + currentItemChanged(0,0); } } -- cgit v1.3.1-10-gc9f91