From 865796375bcfa6be4288cca4243dddcb4092f70b Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 9 Nov 2015 19:47:10 +0100 Subject: 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...). --- source/blender/editors/space_logic/logic_window.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/space_logic') diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 8802ab52725..874e54ba5e7 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -52,6 +52,7 @@ #include "BKE_action.h" #include "BKE_context.h" +#include "BKE_library.h" #include "BKE_main.h" #include "BKE_sca.h" @@ -308,12 +309,13 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event) } if (sa->sound) - ((ID *)sa->sound)->us--; + id_us_min(((ID *)sa->sound)); sa->sound= (struct bSound *)sound; - if (sound) - sound->us++; + if (sound) { + id_us_plus(sound); + } sa->sndnr= 0; didit= 1; -- cgit v1.2.3