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/blenkernel/intern/material.c')
-rw-r--r--source/blender/blenkernel/intern/material.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index b0c57eef25d..47b3f1e34ea 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -50,6 +50,7 @@
#include "BKE_blender.h"
#include "BKE_displist.h"
#include "BKE_global.h"
+#include "BKE_icons.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_material.h"
@@ -76,6 +77,9 @@ void free_material(Material *ma)
if(ma->ramp_col) MEM_freeN(ma->ramp_col);
if(ma->ramp_spec) MEM_freeN(ma->ramp_spec);
+ BKE_icon_delete((struct ID*)ma);
+ ma->id.icon_id = 0;
+
for(ml= ma->layers.first; ml; ml= ml->next)
if(ml->mat) ml->mat->id.us--;