File tree Expand file tree Collapse file tree 3 files changed +4
-24
lines changed
Expand file tree Collapse file tree 3 files changed +4
-24
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -2860,23 +2860,11 @@ void MCButton::freemenu(Boolean force)
28602860 else
28612861 {
28622862 if (!MCStringIsEmpty (menustring) || force)
2863- {
2864- closemenu (False, True);
2865-
2866- /* In this case the button owns the menu so after removing
2867- * any references to it that might exist in the environment
2868- * it must be explicitly deleted. */
2869- MCStack *t_menu_ptr = menu.Get ();
2870- MCdispatcher->removepanel (t_menu_ptr);
2863+ {
2864+ closemenu (False, True);
2865+ MCdispatcher->removepanel (menu);
28712866 MCstacks->deleteaccelerator (this , NULL );
2872- t_menu_ptr->removeneed (this );
2873- t_menu_ptr->dodel ();
2874-
2875- /* It is safe to explicitly delete the menu stack here (rather
2876- * than 'scheduledelete()') as menu stacks and their contents
2877- * can never be on C stack as they don't contain script. */
2878- delete t_menu_ptr;
2879-
2867+ menu->removeneed (this );
28802868 menu = nil;
28812869 }
28822870 }
Original file line number Diff line number Diff line change @@ -1485,13 +1485,6 @@ void MCStack::removereferences()
14851485 {
14861486 MCdispatcher->remove_transient_stack (this );
14871487 }
1488- else if (!parent.IsValid () || parent->gettype () == CT_BUTTON)
1489- {
1490- /* If the parent is a button or non-existant then this is a
1491- * menu-as-stack - registered with MCdispatcher as a panel. This code
1492- * path is hit when performing dodel() on a menu-as-stack before it
1493- * is explicitly deleted in MCButton::freemenu. */
1494- }
14951488 else if (parent->gettype () == CT_STACK)
14961489 {
14971490 remove (parent.GetAs <MCStack>()->substacks );
You can’t perform that action at this time.
0 commit comments