diff options
Diffstat (limited to 'source/blender/blenkernel/intern/lamp.c')
-rw-r--r-- | source/blender/blenkernel/intern/lamp.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c index 8e350896eb8..7fcbd9cafb7 100644 --- a/source/blender/blenkernel/intern/lamp.c +++ b/source/blender/blenkernel/intern/lamp.c @@ -209,8 +209,8 @@ void BKE_lamp_make_local(Lamp *la) if (ob->id.lib == NULL) { ob->data = la_new; - la_new->id.us++; - la->id.us--; + id_us_plus(&la_new->id); + id_us_min(&la->id); } } ob = ob->id.next; @@ -225,8 +225,10 @@ void BKE_lamp_free(Lamp *la) for (a = 0; a < MAX_MTEX; a++) { mtex = la->mtex[a]; - if (mtex && mtex->tex) mtex->tex->id.us--; - if (mtex) MEM_freeN(mtex); + if (mtex && mtex->tex) + id_us_min(&mtex->tex->id); + if (mtex) + MEM_freeN(mtex); } BKE_animdata_free((ID *)la); |