Only register/remove Terminal once

This commit is contained in:
Leroy Hopson 2024-02-18 12:49:08 +13:00
parent 3bed9e7b0f
commit e234b14867
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA

View file

@ -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;
}
}