Skip to content

Fix GDScriptCache to not remove scripts/scenes individually when clearing#69865

Merged
akien-mga merged 1 commit intogodotengine:masterfrom
adamscott:fix-gdscript-cache-remove-script-crash
Dec 10, 2022
Merged

Fix GDScriptCache to not remove scripts/scenes individually when clearing#69865
akien-mga merged 1 commit intogodotengine:masterfrom
adamscott:fix-gdscript-cache-remove-script-crash

Conversation

@adamscott
Copy link
Copy Markdown
Member

Split PR from #69587 for everything about GDScriptCache.

Should prevent GDScript::~GDScript() instances to call GDScriptCache::remove_script() when the GDScript was destructed because GDScriptCache::clear() erased the hashmap. Otherwise, GDScriptCache::remove_script() will call erase() on the hashmap, causing a crash or a heap-use-after-free error.

Fixes #69183 (Crash on exit in the GDScript module when debugging Godot) (hopefully)

@akien-mga akien-mga merged commit 561bafe into godotengine:master Dec 10, 2022
@akien-mga
Copy link
Copy Markdown
Member

Thanks!

@akien-mga akien-mga added this to the 4.0 milestone Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash on exit in the GDScript module when debugging Godot

2 participants