Skip to content

Commit

Permalink
Merge pull request #891 from mihe/classdb-deinit
Browse files Browse the repository at this point in the history
Fix use-after-free when deleting objects from extension terminator
  • Loading branch information
akien-mga authored Oct 11, 2022
2 parents 6696beb + cddaf50 commit 779eaba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/godot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 779eaba

Please sign in to comment.