diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-03-01 13:14:20 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-03-01 13:14:20 +0400 |
commit | 973771723414e49709c100b1c3a48c7bdeb51cdd (patch) | |
tree | d8f1aaf5ef07cc4b748e5176039970771379ac3a /source/blender/editors | |
parent | 9742a6f6cb053ff45060f4bb5f5fa96084b7f5b5 (diff) |
Fix for some unlikely memory leaks, remove redundant checks
Diffstat (limited to 'source/blender/editors')
5 files changed, 14 insertions, 9 deletions
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 4504963a572..f25e09a905d 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -822,7 +822,7 @@ static void calc_text_rcts(SpaceText *st, ARegion *ar, rcti *scroll, rcti *back) /* the scrollbar is non-linear sized */ if (pix_bardiff > 0) { /* the start of the highlight is in the current viewport */ - if (ltexth && st->viewlines && lhlstart >= st->top && lhlstart <= st->top + st->viewlines) { + if (st->viewlines && lhlstart >= st->top && lhlstart <= st->top + st->viewlines) { /* speed the progresion of the start of the highlight through the scrollbar */ hlstart = ( ( (pix_available - pix_bardiff) * lhlstart) / ltexth) + (pix_bardiff * (lhlstart - st->top) / st->viewlines); } @@ -840,7 +840,7 @@ static void calc_text_rcts(SpaceText *st, ARegion *ar, rcti *scroll, rcti *back) } /* the end of the highlight is in the current viewport */ - if (ltexth && st->viewlines && lhlend >= st->top && lhlend <= st->top + st->viewlines) { + if (st->viewlines && lhlend >= st->top && lhlend <= st->top + st->viewlines) { /* speed the progresion of the end of the highlight through the scrollbar */ hlend = (((pix_available - pix_bardiff) * lhlend) / ltexth) + (pix_bardiff * (lhlend - st->top) / st->viewlines); } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index cb137ff7746..4220bcf161b 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1217,7 +1217,7 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d) vmargin = 0.035f * (y2 - y1); uiDrawBox(GL_LINE_LOOP, x1 + hmargin, y1 + vmargin, x2 - hmargin, y2 - vmargin, 2.0f); } - if (ca && (ca->flag & CAM_SHOWSENSOR)) { + if (ca->flag & CAM_SHOWSENSOR) { /* determine sensor fit, and get sensor x/y, for auto fit we * assume and square sensor and only use sensor_x */ float sizex = scene->r.xsch * scene->r.xasp; diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index dabe4c684ab..beb49a5443e 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2636,7 +2636,12 @@ static void createTransUVs(bContext *C, TransInfo *t) } /* note: in prop mode we need at least 1 selected */ - if (countsel == 0) return; + if (countsel == 0) { + if (propconnected) { + MEM_freeN(island_enabled); + } + return; + } t->total = (propmode) ? count : countsel; t->data = MEM_callocN(t->total * sizeof(TransData), "TransObData(UV Editing)"); diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index 105f3a835f3..7150d74c32c 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -200,7 +200,7 @@ typedef struct PChart { } lscm; struct PChartPack { float rescale, area; - float size[2], trans[2]; + float size[2] /* , trans[2] */; } pack; } u; @@ -1100,7 +1100,7 @@ static PFace *p_face_add(PHandle *handle) } static PFace *p_face_add_construct(PHandle *handle, ParamKey key, ParamKey *vkeys, - float *co[3], float *uv[3], int i1, int i2, int i3, + float *co[4], float *uv[4], int i1, int i2, int i3, ParamBool *pin, ParamBool *select) { PFace *f = p_face_add(handle); @@ -4250,7 +4250,7 @@ static void p_add_ngon(ParamHandle *handle, ParamKey key, int nverts, } void param_face_add(ParamHandle *handle, ParamKey key, int nverts, - ParamKey *vkeys, float **co, float **uv, + ParamKey *vkeys, float *co[4], float *uv[4], ParamBool *pin, ParamBool *select, float normal[3]) { PHandle *phandle = (PHandle *)handle; diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.h b/source/blender/editors/uvedit/uvedit_parametrizer.h index 265577555a6..eaea781971d 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.h +++ b/source/blender/editors/uvedit/uvedit_parametrizer.h @@ -59,8 +59,8 @@ void param_face_add(ParamHandle *handle, ParamKey key, int nverts, ParamKey *vkeys, - float **co, - float **uv, + float *co[4], + float *uv[4], ParamBool *pin, ParamBool *select, float face_normal[3]); |