Fix crash using arrow manipulator

This commit is contained in:
Campbell Barton 2017-09-07 01:55:32 +10:00
parent e2f42ff907
commit fb2e0592bc
Notes: blender-bot 2023-02-14 10:09:24 +01:00
Referenced by issue #52672, Segment Fault using manipulator after enabling Object axis display
Referenced by issue #52665, Crash on move using arrow axis of transform gizmo.
Referenced by issue #52657, Blender crashes the minute I interact with the manipulator and Maya interaction mode can not be enabled.
1 changed files with 7 additions and 3 deletions

View File

@ -399,17 +399,21 @@ static void manipulator_arrow_exit(bContext *C, wmManipulator *mpr, const bool c
ArrowManipulator3D *arrow = (ArrowManipulator3D *)mpr;
ManipulatorCommonData *data = &arrow->data;
wmManipulatorProperty *mpr_prop = WM_manipulator_target_property_find(mpr, "offset");
const bool is_prop_valid = WM_manipulator_target_property_is_valid(mpr_prop);
if (!cancel) {
/* Assign incase applying the opetration needs an updated offset
* editmesh bisect needs this. */
data->offset = WM_manipulator_target_property_value_get(mpr, mpr_prop);
if (is_prop_valid) {
data->offset = WM_manipulator_target_property_value_get(mpr, mpr_prop);
}
return;
}
ManipulatorInteraction *inter = mpr->interaction_data;
manipulator_property_value_reset(C, mpr, inter, mpr_prop);
if (is_prop_valid) {
manipulator_property_value_reset(C, mpr, inter, mpr_prop);
}
data->offset = inter->init_offset;
}