From d2ef2715ea942b2d763b9186f69359f0c6c856df Mon Sep 17 00:00:00 2001 From: Bastiaan Olij Date: Fri, 11 Mar 2022 09:59:04 +1100 Subject: [PATCH] Only uninitialise OpenXR on destruct if it was initialised --- modules/openxr/openxr_interface.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/openxr/openxr_interface.cpp b/modules/openxr/openxr_interface.cpp index b89171543f6..39f9153f0d2 100644 --- a/modules/openxr/openxr_interface.cpp +++ b/modules/openxr/openxr_interface.cpp @@ -760,8 +760,9 @@ OpenXRInterface::OpenXRInterface() { } OpenXRInterface::~OpenXRInterface() { - // should already have been called but just in case... - uninitialize(); + if (is_initialized()) { + uninitialize(); + } if (openxr_api) { openxr_api->set_xr_interface(nullptr);