Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit a967d7b

Browse files
committed
[[ Bug 18293 ]] Clear MCmenuobjectptr
The patch for bug 18293 leaves the button as the menu object but the popup stack has been deleted. This means the button can not be deleted itself. This patch checks if the button is the menu object when a menu is being deleted and sets `MCmenuobjectptr` to `nil`. (cherry picked from commit 167281c)
1 parent 9c6832b commit a967d7b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

engine/src/button.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,9 @@ void MCButton::removelink(MCObject *optr)
412412
{
413413
if (menu.IsBound() && optr == menu)
414414
{
415+
if (this == MCmenuobjectptr)
416+
MCmenuobjectptr = nil;
417+
415418
MCValueAssign(menuname, kMCEmptyName);
416419
menu = nil;
417420
}

0 commit comments

Comments
 (0)