patch [#24742] materials.pop() doesn't decrement user count

from Dan Eicher (dna)
This commit is contained in:
Campbell Barton 2010-11-16 02:23:20 +00:00
parent 1f1c0b8027
commit f59b675641

@ -492,6 +492,7 @@ Material *material_pop_id(ID *id, int index)
short *totcol= give_totcolp_id(id); short *totcol= give_totcolp_id(id);
if(index >= 0 && index < (*totcol)) { if(index >= 0 && index < (*totcol)) {
ret= (*matar)[index]; ret= (*matar)[index];
id_us_min((ID *)ret);
if(*totcol <= 1) { if(*totcol <= 1) {
*totcol= 0; *totcol= 0;
MEM_freeN(*matar); MEM_freeN(*matar);