diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-11-19 06:34:16 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-11-19 06:34:16 +0400 |
commit | 95d3286c65e034d9801c2623e81ef92a06e6cc8c (patch) | |
tree | b998653738ccb5984265f686cb4d8bbd33933e6b /source | |
parent | 74a1e4dcf23c0ba2b3ed84888e8c7225f872e9f9 (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_smart_stitch.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index c234d1769b3..28e28238ca9 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -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; } |