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

Fix EditorInspector crash when exiting #91538

Merged
merged 1 commit into from May 7, 2024

Conversation

kitbdev
Copy link
Contributor

@kitbdev kitbdev commented May 3, 2024

The issue describes a freeze and a crash, this only fixes the crash when using --import.

#91168 relies on EditorNode::is_exiting, but it is not set when using --import or --quit and maybe other ways of closing the Editor. Because of this, the check it used didn't work.

I made the node_removed signal connection persist when the EditorInspector is out of the tree. This should fix the crash since the object is cleared by it before NOTIFICATION_PREDELETE is called.

Needs testing on Linux.

Comment on lines +4048 to 4049
if (!sub_inspector && is_inside_tree()) {
get_tree()->disconnect("node_removed", callable_mp(this, &EditorInspector::_node_removed));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

With the current uses of EditorInspector, I don't think this condition will ever be true. As far as I know, all non-sub_inspectors will only be deleted on exit.
I left it here in case this ever changes in the future.

@chrisl8
Copy link
Contributor

chrisl8 commented May 7, 2024

I was able to confirm on MacOS both the crash and that this appears to fix that crash.

This does not appear to be related to the freeze on Windows that it is tied to, but it does fix the crash on MacOS (and presumably Linux).

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

I confirm this fixes the crash when exiting after --import on Linux.

@akien-mga akien-mga merged commit 2532454 into godotengine:master May 7, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@kitbdev kitbdev deleted the fix-inspector-exit-crash branch May 7, 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.

None yet

4 participants