1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Improve unregistering XR interfaces so we don't get crashes in GDExtensions by destroying the XRServer too early

This commit is contained in:
Bastiaan Olij
2021-09-28 12:15:00 +10:00
parent 4f4f73b82f
commit 0623d3676b
3 changed files with 43 additions and 4 deletions

View File

@@ -2689,8 +2689,9 @@ void Main::cleanup(bool p_force) {
rendering_server->global_variables_clear();
if (xr_server) {
// cleanup now before we pull the rug from underneath...
memdelete(xr_server);
// Now that we're unregistering properly in plugins we need to keep access to xr_server for a little longer
// We do however unset our primary interface
xr_server->set_primary_interface(Ref<XRInterface>());
}
unregister_driver_types();
@@ -2706,6 +2707,10 @@ void Main::cleanup(bool p_force) {
unregister_scene_types();
unregister_server_types();
if (xr_server) {
memdelete(xr_server);
}
if (audio_server) {
audio_server->finish();
memdelete(audio_server);