Browse Source

Merge pull request #59001 from BastiaanOlij/only_uninitialise_openxr_if_initialised

Only uninitialise OpenXR on destruct if it was initialized
Rémi Verschelde 3 years ago
parent
commit
259114e9e0
1 changed files with 3 additions and 2 deletions
  1. 3 2
      modules/openxr/openxr_interface.cpp

+ 3 - 2
modules/openxr/openxr_interface.cpp

@@ -760,8 +760,9 @@ OpenXRInterface::OpenXRInterface() {
 }
 }
 
 
 OpenXRInterface::~OpenXRInterface() {
 OpenXRInterface::~OpenXRInterface() {
-	// should already have been called but just in case...
-	uninitialize();
+	if (is_initialized()) {
+		uninitialize();
+	}
 
 
 	if (openxr_api) {
 	if (openxr_api) {
 		openxr_api->set_xr_interface(nullptr);
 		openxr_api->set_xr_interface(nullptr);