Merge pull request #83925 from jsjtxietian/fix-timer-error-when-base-button-leave-tree-and-feedback
Fix BaseButton `shortcut_feedback`'s timer will raise error when the button is removed from the scene tree
This commit is contained in:
commit
e566167b48
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue