Skip to content

Conversation

@Rindbee
Copy link
Contributor

@Rindbee Rindbee commented Mar 18, 2025

Already activated plugins do not need to be added again to editor_plugins_over.

fold_resource() changes active_plugins and is unsafe to call while iterating over active_plugins.

Fix #103909, fix #104250, fix #97577.
Close #103976.

Copy link
Contributor

@0xcafeb33f 0xcafeb33f left a comment

Choose a reason for hiding this comment

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

I tested this PR, and it fixes #103909, #104250, and #97577 on my setup (64-bit Windows).

@akien-mga akien-mga requested a review from KoBeWi March 18, 2025 09:33
@akien-mga akien-mga added bug topic:editor crash cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release labels Mar 18, 2025
@akien-mga akien-mga added this to the 4.5 milestone Mar 18, 2025
@Rindbee Rindbee force-pushed the fix-editor-crash-when-inspecting-2-objects-handled-by-the-same-plugin branch 2 times, most recently from 1c4f00a to f936405 Compare March 18, 2025 10:39
deviousdaemon added a commit to deviousdaemon/godot that referenced this pull request Mar 22, 2025
@KoBeWi
Copy link
Member

KoBeWi commented Mar 24, 2025

When you open a Shader from ShaderMaterial, the material gets folded and you can no longer unfold it.

godot.windows.editor.dev.x86_64_mcFfdq1NlV.mp4

In 4.5 dev1 trying to open it causes a crash 🙃

@Rindbee
Copy link
Contributor Author

Rindbee commented Mar 24, 2025

I couldn't reproduce it.

001.mp4

Tried from v4.5.dev1.official [97241ff], also only error message, no crash. Can you provide the MRP? That sounds like #103976.

@KoBeWi
Copy link
Member

KoBeWi commented Mar 25, 2025

Try with built-in shader.
As for the crash, pretty sure it's random like #103909.

@Rindbee
Copy link
Contributor Author

Rindbee commented Mar 25, 2025

Try with built-in shader.

Still can't reproduce.

@0xcafeb33f
Copy link
Contributor

Try with built-in shader.

I tried with a built-in shader on 4.5dev1 both with and without this PR, and I could not reproduce this issue. What type of node are you adding the material to? Is there anything else open in the editor, or present in the project, at the time of the bug occurring?

@KoBeWi
Copy link
Member

KoBeWi commented Mar 25, 2025

I can't reproduce it anymore, idk what happened. Maybe I reloaded the scene and the shader wasn't closed properly for some reason (normally all built-in shaders are closed with the scene).

The error/crash is probably the same case as #104250, i.e. unfold a shader and restart editor. It's fixed by this PR.

Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

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

I tested various known errors when editing Resources in the inspector and they seem to be all gone. The ShaderMaterial problem I found might not have been caused by this PR, I didn't spot other problems.

Already activated plugins do not need to be added again to `editor_plugins_over`.

`fold_resource()` changes `active_plugins` and is unsafe to call while iterating
over `active_plugins`.
@Rindbee Rindbee force-pushed the fix-editor-crash-when-inspecting-2-objects-handled-by-the-same-plugin branch from f936405 to 411f476 Compare March 25, 2025 16:40
@akien-mga akien-mga merged commit 9328d24 into godotengine:master Mar 25, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 4.4.1.

@akien-mga akien-mga removed the cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release label Mar 25, 2025
@Rindbee Rindbee deleted the fix-editor-crash-when-inspecting-2-objects-handled-by-the-same-plugin branch March 25, 2025 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment