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

qt: Fix crash when moving a Component #378

Merged
merged 1 commit into from
Jan 17, 2022
Merged

qt: Fix crash when moving a Component #378

merged 1 commit into from
Jan 17, 2022

Conversation

aleixpol
Copy link
Collaborator

We need to invalidate the one we are moving, otherwise we get a 2x
unref.

We need to invalidate the one we are moving, otherwise we get a 2x
unref.
@ximion
Copy link
Owner

ximion commented Jan 17, 2022

CI failures are unrelated. Thank you for the patch!

@ximion ximion merged commit ff7dad2 into master Jan 17, 2022
@ximion
Copy link
Owner

ximion commented Jan 17, 2022

I may have merged this too quickly, as it looks like if you don't create a new component for the moved component (other.m_cpt = as_component_new () as well), then the other component will try to unref a nullpointer, which will either be a hard error or at least give a nasty warning (or am I missing something here?).

@aleixpol aleixpol deleted the fix-move-operator branch January 17, 2022 23:54
@aleixpol
Copy link
Collaborator Author

I checked and it does warn when it finds a null object to unref.

#379

@ximion
Copy link
Owner

ximion commented Jan 18, 2022

Jup, sorry - should have actually reviewed this more carefully!

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.

None yet

2 participants