Fix segfault when dragging mouse out of mainmenu window (#1910)

master
Kahrl 2014-12-13 00:39:07 +01:00
parent 581efea60e
commit c4624639e6
1 changed files with 2 additions and 1 deletions

View File

@ -2772,7 +2772,8 @@ bool GUIFormSpecMenu::preprocessEvent(const SEvent& event)
gui::IGUIElement *hovered =
Environment->getRootGUIElement()->getElementFromPoint(
core::position2d<s32>(x, y));
if (hovered->getType() == gui::EGUIET_TAB_CONTROL) {
if (hovered && isMyChild(hovered) &&
hovered->getType() == gui::EGUIET_TAB_CONTROL) {
gui::IGUISkin* skin = Environment->getSkin();
assert(skin != NULL);
gui::IGUIFont *old_font = skin->getFont();