Merge pull request #891 from mihe/classdb-deinit
Fix use-after-free when deleting objects from extension terminatorpull/888/head
commit
779eaba428
|
@ -79,11 +79,12 @@ void GDExtensionBinding::initialize_level(void *userdata, GDNativeInitialization
|
||||||
|
|
||||||
void GDExtensionBinding::deinitialize_level(void *userdata, GDNativeInitializationLevel p_level) {
|
void GDExtensionBinding::deinitialize_level(void *userdata, GDNativeInitializationLevel p_level) {
|
||||||
ClassDB::current_level = p_level;
|
ClassDB::current_level = p_level;
|
||||||
ClassDB::deinitialize(p_level);
|
|
||||||
|
|
||||||
if (terminate_callback) {
|
if (terminate_callback) {
|
||||||
terminate_callback(static_cast<ModuleInitializationLevel>(p_level));
|
terminate_callback(static_cast<ModuleInitializationLevel>(p_level));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ClassDB::deinitialize(p_level);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GDExtensionBinding::InitObject::register_initializer(Callback p_init) const {
|
void GDExtensionBinding::InitObject::register_initializer(Callback p_init) const {
|
||||||
|
|
Loading…
Reference in New Issue