Skip to content

Conversation

@HolonProduction
Copy link
Member

@HolonProduction HolonProduction commented Jan 5, 2026

Fixes #114420
Fixes #98141 (tested using the 4.3 MRP by myself. Not the original one.)

This code originally assumed that if a script object was present for a certain path it would be in either GDScriptCache::shallow_gdscript_cache or GDScriptCache::full_gdscript_cache. However in the linked issues an edge case occurs, were the script object is not in them anymore. This PR also looks into the ResourceCache to handle that edge case correctly.

Idk whether the edge case occurring in the first place is also a bug. But this is the least invasive fix I could think of without opening the whole cyclic ref topic.

@HolonProduction HolonProduction added this to the 4.6 milestone Jan 5, 2026
@HolonProduction HolonProduction requested a review from a team as a code owner January 5, 2026 16:14
@HolonProduction HolonProduction force-pushed the gdscript/inconsistent-is-the-new-consistent branch from 140c922 to 85d7907 Compare January 5, 2026 16:17
@akien-mga
Copy link
Member

The GDScript test suite seems to crash.

@HolonProduction
Copy link
Member Author

Yeah my bad 🤦 This probably wont work without major hacks, because the edge-case does not only remove the script from the cache but also destructs all of its members. So the script in the ResourceCache is not even usable anymore. We can probably reinitialize it to prevent the duplication bug. But this still means that cyclic refs can lead to destruction of GDScripts which are still in use. So a full fix will have to deal with this cyclic ref code.

@HolonProduction HolonProduction force-pushed the gdscript/inconsistent-is-the-new-consistent branch from 85d7907 to 79149da Compare January 5, 2026 17:26
@HolonProduction
Copy link
Member Author

Superseded by #114651

@HolonProduction HolonProduction removed this from the 4.6 milestone Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants