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

Fixed crash when changing file member of custom class #3795

Merged
merged 1 commit into from
Jul 28, 2023

Conversation

bjorn
Copy link
Member

@bjorn bjorn commented Jul 28, 2023

This crash was caused by an infinite recursion happening when changing top-level FilePath values. It only affected Qt 6 builds, because two QVariant values that both hold a FilePath value always compared as unequal due to FilePath not defining a comparision operator.

In addition to adding the comparison operator, I've also added a condition to the updating of the property value. It should only be necessary to update the top-level value when a nested value was changed. Further more, it now sets mUpdatingDetails as another protection against recursive calls.

For completeness I've also added the comparision operator to PropertyValue and ObjectRef, though they would not have caused problems in this context since they're not used as property display values.

Closes #3783

This crash was caused by an infinite recursion happening when changing
top-level FilePath values. It only affected Qt 6 builds, because two
QVariant values that both hold a FilePath value always compared as
unequal due to FilePath not defining a comparision operator.

In addition to adding the comparison operator, I've also added a
condition to the updating of the property value. It should only be
necessary to update the top-level value when a nested value was changed.
Further more, it now sets mUpdatingDetails as another protection against
recursive calls.

For completeness I've also added the comparision operator to
PropertyValue and ObjectRef, though they would not have caused problems
in this context since they're not used as property display values.

Closes mapeditor#3783
@bjorn bjorn merged commit 2613ed6 into mapeditor:master Jul 28, 2023
14 checks passed
@bjorn bjorn deleted the fix-file-property-crash branch July 28, 2023 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when assigning file property in custom type editor
1 participant