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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-09-13 18:23:18 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-09-13 18:24:47 +0300
commit2a01fb61f8402b31b9f85039e28acf310b1da332 (patch)
tree5fe92e44b6aab1dc2059dd4f682708ac89777688 /source
parente9d8b780ae09cb1cf7a03f21e64ec0690f1c7d0b (diff)
Cleanup: use safe free macro & comments
Diffstat (limited to 'source')
-rw-r--r--source/blender/draw/intern/draw_manager.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index a50246bc3e5..573b03d895f 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -319,7 +319,7 @@ enum {
STENCIL_ACTIVE = (1 << 1),
};
-/* Render State */
+/** Render State: No persistent data between draw calls. */
static struct DRWGlobalState {
/* Rendering state */
GPUShader *shader;
@@ -359,7 +359,7 @@ static struct DRWGlobalState {
double cache_time;
} DST = {NULL};
-/* GPU Resource State */
+/** GPU Resource State: Memory storage between drawing. */
static struct DRWResourceState {
GPUTexture **bound_texs;
GPUUniformBuffer **bound_ubos;
@@ -3666,14 +3666,8 @@ void DRW_engines_free(void)
if (globals_ramp)
GPU_texture_free(globals_ramp);
- if (RST.bound_texs) {
- MEM_freeN(RST.bound_texs);
- RST.bound_texs = NULL;
- }
- if (RST.bound_ubos) {
- MEM_freeN(RST.bound_ubos);
- RST.bound_ubos = NULL;
- }
+ MEM_SAFE_FREE(RST.bound_texs);
+ MEM_SAFE_FREE(RST.bound_ubos);
#ifdef WITH_CLAY_ENGINE
BLI_remlink(&R_engines, &DRW_engine_viewport_clay_type);