Skip to content

ScriptEditor::reload_scripts: Only call deferred if not main thread#112663

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
nikitalita:script-editor-fix
Nov 14, 2025
Merged

ScriptEditor::reload_scripts: Only call deferred if not main thread#112663
Repiteo merged 1 commit into
godotengine:masterfrom
nikitalita:script-editor-fix

Conversation

@nikitalita
Copy link
Copy Markdown
Contributor

Sometimes we need to wait for the scripts to be fully reloaded before doing other stuff to update the editor state, and this becomes a problem because reload_scripts always ends up calling deferred, when it's not necessary.

According to @kitbdev , who made the original change to make reload_scripts call deferred:

It doesn't need to be deferred, it just needs to be on the main thread.

Copy link
Copy Markdown
Contributor

@kitbdev kitbdev left a comment

Choose a reason for hiding this comment

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

Makes sense.
Tested for a bit to make sure #71016 didn't return, looks good.

#99861 also deferred the calling of this, so it was being deferred twice in some cases when it doesn't need to be.

@Repiteo Repiteo merged commit ef34c3d into godotengine:master Nov 14, 2025
20 checks passed
@Repiteo
Copy link
Copy Markdown
Contributor

Repiteo commented Nov 14, 2025

Thanks!

@akien-mga akien-mga changed the title ScriptEditor::reload_scripts: only call deferred if not main thread ScriptEditor::reload_scripts: Only call deferred if not main thread Nov 27, 2025
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