diff options
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_navigate_move.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_navigate_move.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/editors/space_view3d/view3d_navigate_move.c b/source/blender/editors/space_view3d/view3d_navigate_move.c index a84da76b05f..90acf20d24f 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_move.c +++ b/source/blender/editors/space_view3d/view3d_navigate_move.c @@ -119,7 +119,8 @@ static int viewmove_modal(bContext *C, wmOperator *op, const wmEvent *event) } if (ret & OPERATOR_FINISHED) { - viewops_data_free(C, op); + viewops_data_free(C, op->customdata); + op->customdata = NULL; } return ret; @@ -131,12 +132,11 @@ static int viewmove_invoke(bContext *C, wmOperator *op, const wmEvent *event) const bool use_cursor_init = RNA_boolean_get(op->ptr, "use_cursor_init"); - /* makes op->customdata */ - viewops_data_create(C, - op, - event, - (viewops_flag_from_prefs() & ~VIEWOPS_FLAG_ORBIT_SELECT) | - (use_cursor_init ? VIEWOPS_FLAG_USE_MOUSE_INIT : 0)); + vod = op->customdata = viewops_data_create( + C, + event, + (viewops_flag_from_prefs() & ~VIEWOPS_FLAG_ORBIT_SELECT) | + (use_cursor_init ? VIEWOPS_FLAG_USE_MOUSE_INIT : 0)); vod = op->customdata; ED_view3d_smooth_view_force_finish(C, vod->v3d, vod->region); @@ -146,7 +146,8 @@ static int viewmove_invoke(bContext *C, wmOperator *op, const wmEvent *event) viewmove_apply( vod, 2 * event->xy[0] - event->prev_xy[0], 2 * event->xy[1] - event->prev_xy[1]); - viewops_data_free(C, op); + viewops_data_free(C, op->customdata); + op->customdata = NULL; return OPERATOR_FINISHED; } @@ -159,7 +160,8 @@ static int viewmove_invoke(bContext *C, wmOperator *op, const wmEvent *event) static void viewmove_cancel(bContext *C, wmOperator *op) { - viewops_data_free(C, op); + viewops_data_free(C, op->customdata); + op->customdata = NULL; } void VIEW3D_OT_move(wmOperatorType *ot) |