Merge pull request #7868 from RandomShaper/fix-touchbutton-crash-2.1

Fix crash if TouchScreenButton is pressed while exiting the tree (2.1)
This commit is contained in:
Rémi Verschelde 2017-02-26 20:27:35 +01:00 committed by GitHub
commit 6490e9ae5b

View file

@ -308,12 +308,14 @@ void TouchScreenButton::_release(bool p_exiting_tree) {
if (action_id!=-1) { if (action_id!=-1) {
Input::get_singleton()->action_release(action); Input::get_singleton()->action_release(action);
InputEvent ie; if (!p_exiting_tree) {
ie.type=InputEvent::ACTION; InputEvent ie;
ie.ID=0; ie.type=InputEvent::ACTION;
ie.action.action=action_id; ie.ID=0;
ie.action.pressed=false; ie.action.action=action_id;
get_tree()->input_event(ie); ie.action.pressed=false;
get_tree()->input_event(ie);
}
} }
if (!p_exiting_tree) { if (!p_exiting_tree) {