Skip to content

Commit 6cbef78

Browse files
Fix crash when removing tilemap in level editor (#3182)
As pop_menu() in MenuManager frees the ObjectMenu which actually invoked the pop_men(), m_object and all other members are not valid anymore. Therefore, pop_menu() needs to be the last thing to call in the menu_action. Fixes #3117
1 parent 9161a95 commit 6cbef78

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/editor/object_menu.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ ObjectMenu::menu_action(MenuItem& item)
108108
case MNID_REMOVE:
109109
m_editor.delete_markers();
110110
m_editor.m_reactivate_request = true;
111-
MenuManager::instance().pop_menu();
112111
m_object->remove_me();
112+
MenuManager::instance().pop_menu();
113113
break;
114114

115115
case MNID_REMOVEFUNCTION:

0 commit comments

Comments
 (0)