浏览代码

Merge pull request #47623 from Bromeon/bugfix/gdnative-cleanup

Fix error in the console: `double free or corruption (!prev)` at exit of GDnative C++ application
Rémi Verschelde 4 年之前
父节点
当前提交
07d26edafc
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      modules/gdnative/nativescript/nativescript.cpp

+ 2 - 0
modules/gdnative/nativescript/nativescript.cpp

@@ -1759,6 +1759,8 @@ void NativeScriptLanguage::unregister_script(NativeScript *script) {
 						C->get().destroy_func.free_func(C->get().destroy_func.method_data);
 						C->get().destroy_func.free_func(C->get().destroy_func.method_data);
 					}
 					}
 				}
 				}
+
+				library_classes.erase(script->lib_path);
 			}
 			}
 
 
 			Map<String, Ref<GDNative>>::Element *G = library_gdnatives.find(script->lib_path);
 			Map<String, Ref<GDNative>>::Element *G = library_gdnatives.find(script->lib_path);