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/node.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/node.c')
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 68d9609e069..70f2f9d26e0 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -2017,8 +2017,8 @@ void ntreeMakeLocal(bNodeTree *ntree) if (node->id == (ID *)ntree) { if (owner_id->lib == NULL) { node->id = (ID *)newtree; - newtree->id.us++; - ntree->id.us--; + id_us_plus(&newtree->id); + id_us_min(&ntree->id); } } } @@ -2106,8 +2106,10 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree) adt->action = ladt->action = action_backup; adt->tmpact = ladt->tmpact = tmpact_backup; - if (action_backup) action_backup->id.us++; - if (tmpact_backup) tmpact_backup->id.us++; + if (action_backup) + id_us_plus(&action_backup->id); + if (tmpact_backup) + id_us_plus(&tmpact_backup->id); } /* end animdata uglyness */ |