summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorPedro J. Estébanez <pedrojrulez@gmail.com>2017-02-22 01:36:31 +0100
committerPedro J. Estébanez <pedrojrulez@gmail.com>2017-02-22 01:37:22 +0100
commit75c68f65129d404e3ab3be1009bd414a450da85e (patch)
tree480e2006a44fe44a50c20ff23f4c7bad21dceca3 /scene
parent6e2bf31e5a8f3dbe18e31b1aff9c26ee184ad8c8 (diff)
Fix crash if TouchScreenButton is pressed while exiting the tree
(cherry picked from commit 5b8d5766f4574b5011b3f258d3e9b34298eb609c)
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/screen_button.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp
index efe23e67f2..4b607e9261 100644
--- a/scene/2d/screen_button.cpp
+++ b/scene/2d/screen_button.cpp
@@ -308,12 +308,14 @@ void TouchScreenButton::_release(bool p_exiting_tree) {
if (action_id!=-1) {
Input::get_singleton()->action_release(action);
- InputEvent ie;
- ie.type=InputEvent::ACTION;
- ie.ID=0;
- ie.action.action=action_id;
- ie.action.pressed=false;
- get_tree()->input_event(ie);
+ if (!p_exiting_tree) {
+ InputEvent ie;
+ ie.type=InputEvent::ACTION;
+ ie.ID=0;
+ ie.action.action=action_id;
+ ie.action.pressed=false;
+ get_tree()->input_event(ie);
+ }
}
if (!p_exiting_tree) {