Skip to content

Commit 9cfdabc

Browse files
authored
Merge pull request #255 from limbonaut/fix-setting-bt-crash
Fix: Keep `BTInstance` alive until update is finished (fixes #254)
2 parents 6644f19 + 23a6e5f commit 9cfdabc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

bt/bt_instance.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ BT::Status BTInstance::update(double p_delta) {
4242
double start = Time::get_singleton()->get_ticks_usec();
4343
#endif
4444

45+
const Ref<BTInstance> keep_alive{ this }; // keep instance alive until update is finished
4546
last_status = root_task->execute(p_delta);
4647
emit_signal(LW_NAME(updated), last_status);
4748

0 commit comments

Comments
 (0)