Avoid a crash in general text field dialog.
onEnterPressed can be executed twice - in event handler and in input manager.
This commit is contained in:
parent
789d75bf26
commit
a7deff5c3e
@ -69,7 +69,7 @@ GUIEngine::EventPropagation GeneralTextFieldDialog::processEvent(const std::stri
|
|||||||
else if (eventSource == "ok")
|
else if (eventSource == "ok")
|
||||||
{
|
{
|
||||||
// If validation callback return true, dismiss the dialog
|
// If validation callback return true, dismiss the dialog
|
||||||
if (m_val_cb(m_title, m_text_field))
|
if (!m_self_destroy && m_val_cb(m_title, m_text_field))
|
||||||
m_self_destroy = true;
|
m_self_destroy = true;
|
||||||
return GUIEngine::EVENT_BLOCK;
|
return GUIEngine::EVENT_BLOCK;
|
||||||
}
|
}
|
||||||
@ -88,7 +88,7 @@ void GeneralTextFieldDialog::onEnterPressedInternal()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_val_cb(m_title, m_text_field))
|
if (!m_self_destroy && m_val_cb(m_title, m_text_field))
|
||||||
m_self_destroy = true;
|
m_self_destroy = true;
|
||||||
|
|
||||||
} // onEnterPressedInternal
|
} // onEnterPressedInternal
|
||||||
|
Loading…
x
Reference in New Issue
Block a user