forked from bartvdbraak/blender
Fix T37464: Crash when pressing "V" in UV/Image editor
Also fix for missing draw-handler free. Delay activating until we know 'stitch_init' succeeds.
This commit is contained in:
parent
74a1e4dcf2
commit
95d3286c65
@ -1613,10 +1613,7 @@ static int stitch_init(bContext *C, wmOperator *op)
|
||||
if (!ar)
|
||||
return 0;
|
||||
|
||||
state = MEM_mallocN(sizeof(StitchState), "stitch state");
|
||||
|
||||
if (!state)
|
||||
return 0;
|
||||
state = MEM_callocN(sizeof(StitchState), "stitch state");
|
||||
|
||||
op->customdata = state;
|
||||
|
||||
@ -1648,7 +1645,6 @@ static int stitch_init(bContext *C, wmOperator *op)
|
||||
}
|
||||
}
|
||||
|
||||
state->draw_handle = ED_region_draw_cb_activate(ar->type, stitch_draw, state, REGION_DRAW_POST_VIEW);
|
||||
/* in uv synch selection, all uv's are visible */
|
||||
if (ts->uv_flag & UV_SYNC_SELECTION) {
|
||||
state->element_map = BM_uv_element_map_create(state->em->bm, false, true);
|
||||
@ -1926,6 +1922,8 @@ static int stitch_init(bContext *C, wmOperator *op)
|
||||
return 0;
|
||||
}
|
||||
|
||||
state->draw_handle = ED_region_draw_cb_activate(ar->type, stitch_draw, state, REGION_DRAW_POST_VIEW);
|
||||
|
||||
stitch_update_header(state, C);
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user