diff options
author | Anish Bhobe <anishbhobe@hotmail.com> | 2022-02-20 11:41:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-20 11:41:39 +0100 |
commit | 102d9fc1b395720dfb16097c7f9971808f21448b (patch) | |
tree | ba89753b551ffafaefc40cb9a815338512c6223b /core/extension | |
parent | 279f105246673c840e52cad8124f2add760e4d83 (diff) |
Fixing iteration for extension level loading.
Extensions are not getting instantiating properly due to iteration calling the wrong levels for loading.
Diffstat (limited to 'core/extension')
-rw-r--r-- | core/extension/native_extension_manager.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/extension/native_extension_manager.cpp b/core/extension/native_extension_manager.cpp index 87737858a8..f269056d14 100644 --- a/core/extension/native_extension_manager.cpp +++ b/core/extension/native_extension_manager.cpp @@ -46,8 +46,8 @@ NativeExtensionManager::LoadStatus NativeExtensionManager::load_extension(const return LOAD_STATUS_NEEDS_RESTART; } //initialize up to current level - for (int32_t i = minimum_level; i < level; i++) { - extension->initialize_library(NativeExtension::InitializationLevel(level)); + for (int32_t i = minimum_level; i <= level; i++) { + extension->initialize_library(NativeExtension::InitializationLevel(i)); } } native_extension_map[p_path] = extension; @@ -69,9 +69,9 @@ NativeExtensionManager::LoadStatus NativeExtensionManager::unload_extension(cons if (minimum_level < MIN(level, NativeExtension::INITIALIZATION_LEVEL_SCENE)) { return LOAD_STATUS_NEEDS_RESTART; } - //initialize up to current level + // deinitialize down to current level for (int32_t i = level; i >= minimum_level; i--) { - extension->deinitialize_library(NativeExtension::InitializationLevel(level)); + extension->deinitialize_library(NativeExtension::InitializationLevel(i)); } } native_extension_map.erase(p_path); |