Fix use-after-free when deleting objects from extension terminator

pull/891/head
Mikael Hermansson 2022-10-10 23:29:04 +02:00
parent 6696bebfa6
commit cddaf50ff8
1 changed files with 2 additions and 1 deletions

View File

@ -79,11 +79,12 @@ void GDExtensionBinding::initialize_level(void *userdata, GDNativeInitialization
void GDExtensionBinding::deinitialize_level(void *userdata, GDNativeInitializationLevel p_level) {
ClassDB::current_level = p_level;
ClassDB::deinitialize(p_level);
if (terminate_callback) {
terminate_callback(static_cast<ModuleInitializationLevel>(p_level));
}
ClassDB::deinitialize(p_level);
}
void GDExtensionBinding::InitObject::register_initializer(Callback p_init) const {