From e234b1486708819854bb60afa44cc48d973e018b Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Sun, 18 Feb 2024 12:49:08 +1300 Subject: [PATCH] Only register/remove Terminal once --- addons/godot_xterm/native/src/register_types.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/godot_xterm/native/src/register_types.cpp b/addons/godot_xterm/native/src/register_types.cpp index 94492ad..060da05 100644 --- a/addons/godot_xterm/native/src/register_types.cpp +++ b/addons/godot_xterm/native/src/register_types.cpp @@ -9,7 +9,7 @@ using namespace godot; void initialize_godot_xterm_module(ModuleInitializationLevel p_level) { - if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { + if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE || ClassDB::class_exists("Terminal")) { return; } @@ -17,7 +17,7 @@ void initialize_godot_xterm_module(ModuleInitializationLevel p_level) { } void uninitialize_godot_xterm_module(ModuleInitializationLevel p_level) { - if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { + if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE && !ClassDB::class_exists("Terminal")) { return; } }