Cleanup: replace MEM_SAFE_FREE -> MEM_freeN

No need to check for NULL in this case.
This commit is contained in:
2018-05-22 07:26:45 +02:00
parent feabab6a9e
commit 67cf4cb5ec
7 changed files with 20 additions and 20 deletions

View File

@@ -3281,7 +3281,7 @@ static Gwn_IndexBuf *mesh_batch_cache_get_edges_adjacency(MeshRenderData *rdata,
else {
GWN_indexbuf_add_line_adj_verts(&elb, v0, v1, v2, v_opposite);
}
}
}
}
}
/* Create edges for remaning non manifold edges. */

View File

@@ -176,7 +176,7 @@ bool ED_armature_pose_select_pick_with_buffer(
uint objects_len = 0;
Object **objects = BKE_object_pose_array_get_unique(view_layer, &objects_len);
ED_pose_deselect_all_multi(objects, objects_len, SEL_DESELECT, true);
MEM_SAFE_FREE(objects);
MEM_freeN(objects);
}
nearBone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
arm->act_bone = nearBone;

View File

@@ -1926,7 +1926,7 @@ static int edbm_select_all_exec(bContext *C, wmOperator *op)
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
}
MEM_SAFE_FREE(objects);
MEM_freeN(objects);
return OPERATOR_FINISHED;
}
@@ -2028,7 +2028,7 @@ bool EDBM_select_pick(bContext *C, const int mval[2], bool extend, bool deselect
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, ob_iter->data);
}
}
MEM_SAFE_FREE(objects);
MEM_freeN(objects);
}
if (efa) {
@@ -2429,7 +2429,7 @@ bool EDBM_selectmode_toggle(
}
if (only_update) {
MEM_SAFE_FREE(objects);
MEM_freeN(objects);
return false;
}
@@ -2482,7 +2482,7 @@ bool EDBM_selectmode_toggle(
DEG_id_tag_update(&scene->id, DEG_TAG_COPY_ON_WRITE);
}
MEM_SAFE_FREE(objects);
MEM_freeN(objects);
return ret;
}
@@ -2929,7 +2929,7 @@ static int edbm_select_linked_exec(bContext *C, wmOperator *op)
}
MEM_SAFE_FREE(objects);
MEM_freeN(objects);
return OPERATOR_FINISHED;
}
@@ -3101,7 +3101,7 @@ static int edbm_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmE
has_edges = true;
}
}
MEM_SAFE_FREE(objects);
MEM_freeN(objects);
if (has_edges == false) {
return OPERATOR_CANCELLED;
}
@@ -3763,7 +3763,7 @@ static int edbm_select_nth_exec(bContext *C, wmOperator *op)
EDBM_update_generic(em, false, false);
}
}
MEM_SAFE_FREE(objects);
MEM_freeN(objects);
if (!found_active_elt) {
BKE_report(op->reports, RPT_ERROR,

View File

@@ -131,7 +131,7 @@ static int edbm_subdivide_exec(bContext *C, wmOperator *op)
EDBM_update_generic(em, true, true);
}
MEM_SAFE_FREE(objects);
MEM_freeN(objects);
return OPERATOR_FINISHED;
}
@@ -478,7 +478,7 @@ static int edbm_delete_exec(bContext *C, wmOperator *op)
EDBM_update_generic(em, true, true);
}
MEM_SAFE_FREE(objects);
MEM_freeN(objects);
return changed_multi ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
}
@@ -603,7 +603,7 @@ static int edbm_delete_loose_exec(bContext *C, wmOperator *op)
edbm_report_delete_info(op->reports, totelem_old, totelem_new);
MEM_SAFE_FREE(objects);
MEM_freeN(objects);
return OPERATOR_FINISHED;
}

View File

@@ -1061,7 +1061,7 @@ void ED_uvedit_draw_main(
Object *ob_iter = objects[ob_index];
draw_uvs(sima, scene, view_layer, ob_iter, depsgraph);
}
MEM_SAFE_FREE(objects);
MEM_freeN(objects);
}
else {
draw_uvs_texpaint(sima, scene, view_layer, obact);

View File

@@ -2036,7 +2036,7 @@ static int uv_select_all_exec(bContext *C, wmOperator *op)
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
}
MEM_SAFE_FREE(objects);
MEM_freeN(objects);
return OPERATOR_FINISHED;
}
@@ -2500,7 +2500,7 @@ static int uv_select_linked_internal(bContext *C, wmOperator *op, const wmEvent
}
if (!uv_find_nearest_edge_multi(scene, ima, objects, objects_len, co, &hit)) {
MEM_SAFE_FREE(objects);
MEM_freeN(objects);
return OPERATOR_CANCELLED;
}
}
@@ -3032,7 +3032,7 @@ static int uv_border_select_exec(bContext *C, wmOperator *op)
}
}
MEM_SAFE_FREE(objects);
MEM_freeN(objects);
return changed_multi ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
}

View File

@@ -839,7 +839,7 @@ static int pack_islands_exec(bContext *C, wmOperator *op)
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs(view_layer, &objects_len);
if (!uvedit_have_selection_multi(scene, objects, objects_len, true)) {
MEM_SAFE_FREE(objects);
MEM_freeN(objects);
return OPERATOR_CANCELLED;
}
@@ -856,7 +856,7 @@ static int pack_islands_exec(bContext *C, wmOperator *op)
WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
}
MEM_SAFE_FREE(objects);
MEM_freeN(objects);
return OPERATOR_FINISHED;
}
@@ -1357,7 +1357,7 @@ static int unwrap_exec(bContext *C, wmOperator *op)
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len);
if (!uvedit_have_selection_multi(scene, objects, objects_len, implicit)) {
MEM_SAFE_FREE(objects);
MEM_freeN(objects);
return OPERATOR_CANCELLED;
}
@@ -1418,7 +1418,7 @@ static int unwrap_exec(bContext *C, wmOperator *op)
ED_uvedit_pack_islands_multi(scene, objects, objects_len, true, true, true);
MEM_SAFE_FREE(objects);
MEM_freeN(objects);
return OPERATOR_FINISHED;
}