This commit is contained in:
Waridley 2021-11-11 02:42:27 +09:00 committed by GitHub
commit 380b828b40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -343,10 +343,13 @@ bool GDNative::initialize() {
#endif
if (library->should_load_once()) {
if (GDNativeLibrary::loaded_libraries.has(lib_path)) {
Map<String, Vector<Ref<GDNative>>>::Element *V = GDNativeLibrary::loaded_libraries.find(lib_path);
if (V) {
// already loaded. Don't load again.
// copy some of the stuff instead
this->native_handle = GDNativeLibrary::loaded_libraries[lib_path][0]->native_handle;
Vector<Ref<GDNative>> &gdnatives = V->get();
gdnatives.push_back(Ref<GDNative>(this));
this->native_handle = gdnatives[0]->native_handle;
initialized = true;
return true;
}