File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,16 @@ GDExtensionManager::LoadStatus GDExtensionManager::_load_extension_internal(cons
5555 gdextension_class_icon_paths[kv.key ] = kv.value ;
5656 }
5757
58+ if (p_first_load) {
59+ // On first load, we automatically do everything at once. For reload, we need to
60+ // defer this until a little later.
61+ _finish_load_extension (p_extension);
62+ }
63+
64+ return LOAD_STATUS_OK;
65+ }
66+
67+ void GDExtensionManager::_finish_load_extension (const Ref<GDExtension> &p_extension) {
5868#ifdef TOOLS_ENABLED
5969 // Signals that a new extension is loaded so GDScript can register new class names.
6070 emit_signal (" extension_loaded" , p_extension);
@@ -67,8 +77,6 @@ GDExtensionManager::LoadStatus GDExtensionManager::_load_extension_internal(cons
6777 p_extension->startup_callback ();
6878 }
6979 }
70-
71- return LOAD_STATUS_OK;
7280}
7381
7482GDExtensionManager::LoadStatus GDExtensionManager::_unload_extension_internal (const Ref<GDExtension> &p_extension) {
@@ -186,6 +194,8 @@ GDExtensionManager::LoadStatus GDExtensionManager::reload_extension(const String
186194
187195 extension->finish_reload ();
188196
197+ _finish_load_extension (extension);
198+
189199 return LOAD_STATUS_OK;
190200#endif
191201}
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ class GDExtensionManager : public Object {
5757
5858private:
5959 LoadStatus _load_extension_internal (const Ref<GDExtension> &p_extension, bool p_first_load);
60+ void _finish_load_extension (const Ref<GDExtension> &p_extension);
6061 LoadStatus _unload_extension_internal (const Ref<GDExtension> &p_extension);
6162
6263#ifdef TOOLS_ENABLED
You can’t perform that action at this time.
0 commit comments