fix: sound event patchboard singleton not being destroyed

This commit is contained in:
Sara 2025-08-09 15:18:48 +02:00
parent 68abfdd383
commit f40f01a569

View file

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