From 23a6e5fdfe330b70db6ea298f2c040c84742d43b Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Wed, 4 Dec 2024 17:48:23 +0100 Subject: [PATCH] Fix: Keep `BTInstance` alive until update is finished Fixes #254 --- bt/bt_instance.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/bt/bt_instance.cpp b/bt/bt_instance.cpp index 2f95dc8..dd0df10 100644 --- a/bt/bt_instance.cpp +++ b/bt/bt_instance.cpp @@ -42,6 +42,7 @@ BT::Status BTInstance::update(double p_delta) { double start = Time::get_singleton()->get_ticks_usec(); #endif + const Ref keep_alive{ this }; // keep instance alive until update is finished last_status = root_task->execute(p_delta); emit_signal(LW_NAME(updated), last_status);