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

[Studio] Fixed crash in debug builds when right-clicking on some waypoints #2234

Merged
merged 1 commit into from
Jul 19, 2021

Conversation

rodolforg
Copy link
Contributor

@rodolforg rodolforg commented Jul 18, 2021

It only makes sense in this case.
Debug builds crash otherwise due to an assert in find_param_desc().

Reported by GregorysonofCarl here:
https://forums.synfig.org/t/crash-when-right-clicking-waypoints/12391/6

@rodolforg
Copy link
Contributor Author

The crash affects 1.4.x branch too, but only for debug builds.

It only makes sense in this case.
Debug builds crash otherwise due to an assert in find_param_desc().

Reported by GregorysonofCarl here:
https://forums.synfig.org/t/crash-when-right-clicking-waypoints/12391/6
@rodolforg
Copy link
Contributor Author

Force pushed to improve the commit message only.

@@ -254,8 +254,9 @@ void Widget_Waypoint::set_valuedesc(synfigapp::ValueDesc& value_desc)

value_widget->set_value_desc(value_desc);
synfig::ParamDesc param_desc;
if (value_desc.find_param_desc(param_desc))
value_widget->set_param_desc(param_desc);
if (value_desc.parent_is_layer())
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like it should be:

	if (value_desc.parent_is_layer()) {
		value_desc.find_param_desc(param_desc);
		value_widget->set_param_desc(param_desc);
        }

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought so, but we use a lot of dialogs that are kept hidden/shown during the whole application lifetime. So I thought it would be safer to reset param_desc.

@ice0 ice0 changed the title [Studio] pass param_desc only if value_desc is a layer [Studio] Fixed crash in debug builds when right-clicking on some waypoints Jul 19, 2021
@ice0 ice0 added the Crash label Jul 19, 2021
@ice0 ice0 merged commit 1dce9a1 into synfig:master Jul 19, 2021
@ice0
Copy link
Collaborator

ice0 commented Jul 19, 2021

Merged. Thank you!

@rodolforg rodolforg deleted the fix-waypoint-dialog-setup branch October 25, 2021 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants