Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/src/editmesh_lib.c')
-rw-r--r--source/blender/src/editmesh_lib.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/src/editmesh_lib.c b/source/blender/src/editmesh_lib.c
index d40ab35a4db..6e9fc7260f6 100644
--- a/source/blender/src/editmesh_lib.c
+++ b/source/blender/src/editmesh_lib.c
@@ -798,11 +798,11 @@ void EM_add_data_layer(CustomData *data, int type)
return;
olddata= *data;
- olddata.layers= MEM_dupallocN(olddata.layers);
- CustomData_add_layer(data, type, 0, NULL);
+ olddata.layers= (olddata.layers)? MEM_dupallocN(olddata.layers): NULL;
+ CustomData_add_layer(data, type, 0, NULL, 0);
update_data_blocks(&olddata, data);
- MEM_freeN(olddata.layers);
+ if (olddata.layers) MEM_freeN(olddata.layers);
}
void EM_free_data_layer(CustomData *data, int type)
@@ -813,11 +813,11 @@ void EM_free_data_layer(CustomData *data, int type)
return;
olddata= *data;
- olddata.layers= MEM_dupallocN(olddata.layers);
- CustomData_free_layer(data, type);
+ olddata.layers= (olddata.layers)? MEM_dupallocN(olddata.layers): NULL;
+ CustomData_free_layer(data, type, 0);
update_data_blocks(&olddata, data);
- MEM_freeN(olddata.layers);
+ if (olddata.layers) MEM_freeN(olddata.layers);
}
/* ******** EXTRUDE ********* */