[Bf-blender-cvs] [c01e6a3c50d] greasepencil-object: Cleanup: Improve comments
Antonio Vazquez
noreply at git.blender.org
Tue Mar 20 19:30:48 CET 2018
Commit: c01e6a3c50d4de5253a02e77d13a440499ddf7af
Author: Antonio Vazquez
Date: Tue Mar 20 19:30:40 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBc01e6a3c50d4de5253a02e77d13a440499ddf7af
Cleanup: Improve comments
===================================================================
M source/blender/draw/engines/gpencil/gpencil_engine.c
===================================================================
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 6d9b94efb8c..7eb810a7766 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -681,8 +681,12 @@ static void gpencil_prepare_fast_drawing(GPENCIL_StorageList *stl, DefaultFrameb
static void gpencil_free_obj_list(GPENCIL_StorageList *stl)
{
- /* free memory */
- /* clear temp objects created for display only */
+ /* Clear temp objects created for display arrays only. These objects are created
+ * while the draw manager draw the scene, but only to hold the strokes data.
+ * see: gp_array_modifier_make_instances()
+ *
+ * the normal objects are not freed because they are not tagged with NO_MAIN
+ */
for (int i = 0; i < stl->g_data->gp_cache_used; i++) {
Object *ob = stl->g_data->gp_object_cache[i].ob;
if (((ob->id.tag & LIB_TAG_COPY_ON_WRITE) == 0) &&
@@ -691,6 +695,8 @@ static void gpencil_free_obj_list(GPENCIL_StorageList *stl)
MEM_SAFE_FREE(ob);
}
}
+
+ /* free the cache itself */
MEM_SAFE_FREE(stl->g_data->gp_object_cache);
}
More information about the Bf-blender-cvs
mailing list