mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 04:06:14 +00:00
Merge pull request #88689 from dsnopek/openxr-extension-wrapper-crash
Fix crash when using OpenXR extension wrappers from GDExtension
This commit is contained in:
commit
60b927b4cf
@ -1532,7 +1532,13 @@ void OpenXRAPI::register_extension_metadata() {
|
||||
|
||||
void OpenXRAPI::cleanup_extension_wrappers() {
|
||||
for (OpenXRExtensionWrapper *extension_wrapper : registered_extension_wrappers) {
|
||||
memdelete(extension_wrapper);
|
||||
// Fix crash when the extension wrapper comes from GDExtension.
|
||||
OpenXRExtensionWrapperExtension *gdextension_extension_wrapper = dynamic_cast<OpenXRExtensionWrapperExtension *>(extension_wrapper);
|
||||
if (gdextension_extension_wrapper) {
|
||||
memdelete(gdextension_extension_wrapper);
|
||||
} else {
|
||||
memdelete(extension_wrapper);
|
||||
}
|
||||
}
|
||||
registered_extension_wrappers.clear();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user