diff --git a/modules/wave_survival/register_types.cpp b/modules/wave_survival/register_types.cpp index c9c8304e..169e706e 100644 --- a/modules/wave_survival/register_types.cpp +++ b/modules/wave_survival/register_types.cpp @@ -57,11 +57,14 @@ void initialize_wave_survival_module(ModuleInitializationLevel p_level) { GDREGISTER_CLASS(MuzzleEffect); memnew(SoundEventPatchboard); - Engine::get_singleton()->add_singleton(Engine::Singleton("SoundEventPatchboard", SoundEventPatchboard::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton(SoundEventPatchboard::get_class_static(), SoundEventPatchboard::get_singleton())); } void uninitialize_wave_survival_module(ModuleInitializationLevel p_level) { if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { return; } + + Engine::get_singleton()->remove_singleton(SoundEventPatchboard::get_class_static()); + memdelete(SoundEventPatchboard::get_singleton()); }