mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
Fix BaseButton.shortcut_feedback's timer raises errors
when a button is removed from the scene tree
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user