diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-11-09 21:47:10 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-11-09 23:00:53 +0300 |
commit | 865796375bcfa6be4288cca4243dddcb4092f70b (patch) | |
tree | 5264d4b9b0f9d392b6e1b942e0f6fd802de1fff4 /source/blender/blenkernel/intern/speaker.c | |
parent | cf959a879eb5ffbdfa573c5f3a00965e69d7a976 (diff) |
Cleanup: avoid incrementing/decrementing id->us outside of BKE_library.
We have callbacks for that, they also do some checks and help ensure things are done
correctly. Only place where this is assumed not true is blenloader (since here we
may affect refcount of library IDs as well...).
Diffstat (limited to 'source/blender/blenkernel/intern/speaker.c')
-rw-r--r-- | source/blender/blenkernel/intern/speaker.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/speaker.c b/source/blender/blenkernel/intern/speaker.c index 30296c7813c..3b5b8ce3f9a 100644 --- a/source/blender/blenkernel/intern/speaker.c +++ b/source/blender/blenkernel/intern/speaker.c @@ -72,7 +72,7 @@ Speaker *BKE_speaker_copy(Speaker *spk) spkn = BKE_libblock_copy(&spk->id); if (spkn->sound) - spkn->sound->id.us++; + id_us_plus(&spkn->sound->id); if (spk->id.lib) { BKE_id_lib_local_paths(G.main, spk->id.lib, &spkn->id); @@ -123,8 +123,8 @@ void BKE_speaker_make_local(Speaker *spk) if (ob->id.lib == NULL) { ob->data = spk_new; - spk_new->id.us++; - spk->id.us--; + id_us_plus(&spk_new->id); + id_us_min(&spk->id); } } ob = ob->id.next; @@ -135,7 +135,7 @@ void BKE_speaker_make_local(Speaker *spk) void BKE_speaker_free(Speaker *spk) { if (spk->sound) - spk->sound->id.us--; + id_us_min(&spk->sound->id); BKE_animdata_free((ID *)spk); } |