diff options
| author | jsjtxietian <jsjtxietian@outlook.com> | 2023-10-25 14:47:25 +0800 |
|---|---|---|
| committer | jsjtxietian <jsjtxietian@outlook.com> | 2023-10-25 14:47:25 +0800 |
| commit | 47d601b3160c5ad77bc9de0145120c2a4ff372d7 (patch) | |
| tree | 9540ad39309165fa58a172240cc5d3ea0142f24d /scene | |
| parent | ea0ab441c836091f3ede370d88b5fe1453b7a653 (diff) | |
| download | redot-engine-47d601b3160c5ad77bc9de0145120c2a4ff372d7.tar.gz | |
Fix BaseButton.shortcut_feedback's timer raises errors
when a button is removed from the scene tree
Diffstat (limited to 'scene')
| -rw-r--r-- | scene/gui/base_button.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index f57afb66b3..66b14dc967 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -380,7 +380,7 @@ void BaseButton::shortcut_input(const Ref<InputEvent> &p_event) { queue_redraw(); accept_event(); - if (shortcut_feedback) { + if (shortcut_feedback && is_inside_tree()) { if (shortcut_feedback_timer == nullptr) { shortcut_feedback_timer = memnew(Timer); shortcut_feedback_timer->set_one_shot(true); |
