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

EditorHelpBit: Workaround crash renaming named class inheriting @tool class #102729

Merged

Conversation

akien-mga
Copy link
Member

This only addresses the symptom, not the root cause of the problem.

In the MRP of the linked issue, the parent class seems to not be found in DocData after renaming its child class, which seems weird. Force opening the docs of the parent class can work it around, so we seem to have inconsistent state.

Changed the same code in EditorHelp for good measure.

Fixes #102718.


A more proper fix would be to ensure that the parent class isn't lost from the DocData when renaming the child class. Maybe we're lacking some explicit update somewhere.

The problem might also be related to the fact that the parent class is @tool in the MRP, but the derived class isn't:

$ cat mytool.gd
@tool
class_name MyTool
extends Node
$ cat test.gd
class_name Test500
extends MyTool

@akien-mga
Copy link
Member Author

For the record, there seems to be cases where the derived class doesn't register its parent class as inherits at all. This is what I get right after opening the MRP, without changing the derived class name, and checking it in the Create New Node dialog (no inherits):

image

If I make Test800 a @tool class too, then it works:

image

If I remove @tool, it still works fine, even after renaming the class, but I suspect some state remains in the editor (I know @tool scripts are iffy and sometimes I need to reload a project to get them to properly update).

So anyway, this fixes the crash, but there's still lingering issues we'll want to tackle at some point.

…l` class

This only addresses the symptom, not the root cause of the problem.

In the MRP of the linked issue, the parent class seems to not be found in DocData
after renaming its child class, which seems weird. Force opening the docs of the
parent class can work it around, so we seem to have inconsistent state.

Changed the same code in EditorHelp for good measure.

Fixes godotengine#102718.
Copy link
Member

@dalexeev dalexeev left a comment

Choose a reason for hiding this comment

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

Looks good as a workaround, but we should investigate why the crashes started recently, even though the first case has existed without a null pointer check for quite some time.

@Repiteo Repiteo merged commit 723f091 into godotengine:master Feb 13, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Feb 13, 2025

Thanks!

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.

Occassional crash when selecting node to add via "Create New Node" dialogue
3 participants