GDExtension: Prevent issues with the editor trying to reload GDExtensions through its usual mechanism #83285
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This attempts to fix the bug described in PR #83260 in a slightly different way
Basically, we can't ever have multiple
GDExtension
resource objects that loaded the same library, because it affects global data on both the Godot and GDExtension side. Also, I don't think the editor should be trying to reload GDExtensions through the usual mechanism, because they need to be handled in a special way.This is a draft presently, because I want to also uncomment theeditor_can_reload_from_file()
that's added here, but I'd like @Klaim to test if this fixes their issue, and I think that line will make it so they can't reproduce the conditions that led to the crash in their testing. If they can confirm this fix, then I'll uncomment that line and take this out of draft.