From d02b38d41118101a8813a5d29013439a291e6cf1 Mon Sep 17 00:00:00 2001 From: Mikhail Tishin Date: Sun, 4 Feb 2024 14:41:23 +0300 Subject: [PATCH] Add null check for gdextension deinitialization (cherry picked from commit dc4c6cfb9b78bca962121510b01b7a7605bbbd45) --- core/extension/gdextension.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/extension/gdextension.cpp b/core/extension/gdextension.cpp index e2af1970b64..82100f7b50f 100644 --- a/core/extension/gdextension.cpp +++ b/core/extension/gdextension.cpp @@ -794,6 +794,9 @@ void GDExtension::deinitialize_library(InitializationLevel p_level) { ERR_FAIL_COND(p_level > int32_t(level_initialized)); level_initialized = int32_t(p_level) - 1; + + ERR_FAIL_NULL(initialization.deinitialize); + initialization.deinitialize(initialization.userdata, GDExtensionInitializationLevel(p_level)); }