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:
commit
6490e9ae5b
1 changed files with 8 additions and 6 deletions
|
@ -308,6 +308,7 @@ 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);
|
||||||
|
if (!p_exiting_tree) {
|
||||||
InputEvent ie;
|
InputEvent ie;
|
||||||
ie.type=InputEvent::ACTION;
|
ie.type=InputEvent::ACTION;
|
||||||
ie.ID=0;
|
ie.ID=0;
|
||||||
|
@ -315,6 +316,7 @@ void TouchScreenButton::_release(bool p_exiting_tree) {
|
||||||
ie.action.pressed=false;
|
ie.action.pressed=false;
|
||||||
get_tree()->input_event(ie);
|
get_tree()->input_event(ie);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!p_exiting_tree) {
|
if (!p_exiting_tree) {
|
||||||
emit_signal("released");
|
emit_signal("released");
|
||||||
|
|
Loading…
Reference in a new issue