Merge pull request #66687 from Waridley/free_gdn_method_binds
free NativeExtensionMethodBinds on unregister
This commit is contained in:
commit
a47f9bd53a
1 changed files with 5 additions and 1 deletions
|
@ -1538,7 +1538,11 @@ void ClassDB::register_extension_class(ObjectNativeExtension *p_extension) {
|
|||
}
|
||||
|
||||
void ClassDB::unregister_extension_class(const StringName &p_class) {
|
||||
ERR_FAIL_COND(!classes.has(p_class));
|
||||
ClassInfo *c = classes.getptr(p_class);
|
||||
ERR_FAIL_COND_MSG(!c, "Class " + p_class + "does not exist");
|
||||
for (KeyValue<StringName, MethodBind *> &F : c->method_map) {
|
||||
memdelete(F.value);
|
||||
}
|
||||
classes.erase(p_class);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue