You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
Destroy AudioServer after other non-core types are unregistered
This is important for some GDNative bindings and probably for Mono. They may keep references to audio objects which are freed when they are unregistered. If AudioServer is already deleted at that point, it causes segfaults.
This commit is contained in:
@@ -1845,11 +1845,6 @@ void Main::cleanup() {
|
|||||||
EditorNode::unregister_editor_types();
|
EditorNode::unregister_editor_types();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (audio_server) {
|
|
||||||
audio_server->finish();
|
|
||||||
memdelete(audio_server);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (arvr_server) {
|
if (arvr_server) {
|
||||||
// cleanup now before we pull the rug from underneath...
|
// cleanup now before we pull the rug from underneath...
|
||||||
memdelete(arvr_server);
|
memdelete(arvr_server);
|
||||||
@@ -1861,6 +1856,11 @@ void Main::cleanup() {
|
|||||||
unregister_scene_types();
|
unregister_scene_types();
|
||||||
unregister_server_types();
|
unregister_server_types();
|
||||||
|
|
||||||
|
if (audio_server) {
|
||||||
|
audio_server->finish();
|
||||||
|
memdelete(audio_server);
|
||||||
|
}
|
||||||
|
|
||||||
OS::get_singleton()->finalize();
|
OS::get_singleton()->finalize();
|
||||||
finalize_physics();
|
finalize_physics();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user