Skip to content

Commit

Permalink
Merge pull request #83925 from jsjtxietian/fix-timer-error-when-base-…
Browse files Browse the repository at this point in the history
…button-leave-tree-and-feedback

Fix BaseButton `shortcut_feedback`'s timer will raise error when the button is removed from the scene tree
  • Loading branch information
akien-mga committed Oct 26, 2023
2 parents 8835db5 + 47d601b commit e566167
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scene/gui/base_button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e566167

Please sign in to comment.