mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-01 15:55:45 +00:00
GUI: Fix access to deleted widget after rebuilding a dialog
The issue was with the focus or mouse widget as it may not be a direct child of the dialog (it may for example be a child of the tab widget in the options dialog) and removing a widget was not resetting the mouse of focus widget if that widget was not a direct child.
This commit is contained in:
parent
91125bcbcd
commit
78561ca94d
@ -361,11 +361,11 @@ Widget *Dialog::findWidget(const char *name) {
|
||||
}
|
||||
|
||||
void Dialog::removeWidget(Widget *del) {
|
||||
if (del == _mouseWidget)
|
||||
if (del == _mouseWidget || del->containsWidget(_mouseWidget))
|
||||
_mouseWidget = NULL;
|
||||
if (del == _focusedWidget)
|
||||
if (del == _focusedWidget || del->containsWidget(_focusedWidget))
|
||||
_focusedWidget = NULL;
|
||||
if (del == _dragWidget)
|
||||
if (del == _dragWidget || del->containsWidget(_dragWidget))
|
||||
_dragWidget = NULL;
|
||||
|
||||
GuiObject::removeWidget(del);
|
||||
|
Loading…
x
Reference in New Issue
Block a user