diff --git a/editor/limbo_ai_editor_plugin.cpp b/editor/limbo_ai_editor_plugin.cpp index 292ae1e..51c5c15 100644 --- a/editor/limbo_ai_editor_plugin.cpp +++ b/editor/limbo_ai_editor_plugin.cpp @@ -953,6 +953,7 @@ void LimboAIEditor::_tab_clicked(int p_tab) { } void LimboAIEditor::_tab_closed(int p_tab) { + ERR_FAIL_INDEX(p_tab, history.size()); history.remove_at(p_tab); idx_history = MIN(idx_history, history.size() - 1); if (idx_history < 0) { @@ -979,6 +980,7 @@ void LimboAIEditor::_update_tabs() { tab_bar->add_tab(tab_name, LimboUtility::get_singleton()->get_task_icon("BehaviorTree")); } if (idx_history >= 0) { + ERR_FAIL_INDEX(idx_history, history.size()); tab_bar->set_current_tab(idx_history); } updating_tabs = false; diff --git a/editor/task_tree.cpp b/editor/task_tree.cpp index ab27269..725e888 100644 --- a/editor/task_tree.cpp +++ b/editor/task_tree.cpp @@ -213,7 +213,7 @@ void TaskTree::unload() { last_selected->disconnect(LW_NAME(changed), on_task_changed); } - bt->unreference(); + bt.unref(); tree->clear(); }