Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDExtension: Prevent issues with the editor trying to reload GDExtensions through its usual mechanism #83285

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

dsnopek
Copy link
Contributor

@dsnopek dsnopek commented Oct 13, 2023

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 the editor_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.

@Klaim
Copy link

Klaim commented Oct 13, 2023

I have now tested this PR with my extension, I hot-reloaded many times (more than 10) with different kinds of changes and didnt find any issue, no crash or suspicious behavior when closing. (using Godot 4.2-master in debug in VS) 👍🏽

@dsnopek dsnopek force-pushed the gdextension-double-reload branch from 655b827 to 16a86b9 Compare October 13, 2023 18:24
@dsnopek
Copy link
Contributor Author

dsnopek commented Oct 13, 2023

Awesome, thanks!

I've uncommented the line that should prevent the editor from attempting the reload in the first place. It looks like I forgot to press the "Convert to draft" link earlier, but this is the point where I would have marked it as ready for review. :-)

@dsnopek dsnopek modified the milestones: 4.x, 4.2 Oct 13, 2023
@dsnopek dsnopek added the crash label Oct 13, 2023
@Klaim
Copy link

Klaim commented Oct 13, 2023

This version is still working well for me 👍🏽

Copy link
Member

@vnen vnen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akien-mga akien-mga merged commit eb9903b into godotengine:master Oct 16, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@dsnopek dsnopek deleted the gdextension-double-reload branch July 22, 2024 15:28
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.

4 participants