-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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 editor inspector crashing when the old object is no longer valid #94101
Fix editor inspector crashing when the old object is no longer valid #94101
Conversation
Node editing should not happen during editor exit. |
@KoBeWi This happens when the old object is an invalid instance, regardless of what the new object is. |
But it still shouldn't happen during exit. Stack trace with symbols could be useful. |
It seems some use of EditorInspector doesn't clear its edited object before it gets deleted, but it could be a lot of places. Also it's important to have that edit: Finding the root cause may not be easy so this fix looks good to me to prevent the crash. |
Did you test if it actually fixes the crash? godot/core/variant/variant.cpp Lines 2152 to 2154 in 97b8ad1
AFAIK the only way to safely validate an object is using ObjectID. It will still crash with raw pointers. |
@KoBeWi Yes, I did. It fixes the crash. From the OP:
I added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't reproduce the crash, but the change does not break anything. If you say it fixes something then fine.
Thanks! |
This fixes a crash when the editor inspector tries to edit a new object when the old object is an invalid instance. See the stack trace below. I ran into this situation when closing the editor with a complex scene open. Since this is editor code that only runs once in awhile, it's not performance critical. I tested that this fix is correct by adding an else statement and confirmed that it reached there.