Cleanup: use newlibadr_us
authorCampbell Barton <ideasman42@gmail.com>
Thu, 8 Oct 2015 08:42:10 +0000 (19:42 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 8 Oct 2015 08:42:10 +0000 (19:42 +1100)
source/blender/blenloader/intern/readfile.c

index aeb3168c1bc25098194a846a3e4d86b2ba87466d..9ee99c155d582ebc26641c017bf4c3402c30ecd6 100644 (file)
@@ -5576,16 +5576,10 @@ static void lib_link_scene(FileData *fd, Main *main)
                                        }
                                }
                                if (seq->clip) {
-                                       seq->clip = newlibadr(fd, sce->id.lib, seq->clip);
-                                       if (seq->clip) {
-                                               seq->clip->id.us++;
-                                       }
+                                       seq->clip = newlibadr_us(fd, sce->id.lib, seq->clip);
                                }
                                if (seq->mask) {
-                                       seq->mask = newlibadr(fd, sce->id.lib, seq->mask);
-                                       if (seq->mask) {
-                                               seq->mask->id.us++;
-                                       }
+                                       seq->mask = newlibadr_us(fd, sce->id.lib, seq->mask);
                                }
                                if (seq->scene_camera) {
                                        seq->scene_camera = newlibadr(fd, sce->id.lib, seq->scene_camera);
@@ -7174,11 +7168,7 @@ static void lib_link_speaker(FileData *fd, Main *main)
                if (spk->id.flag & LIB_NEED_LINK) {
                        if (spk->adt) lib_link_animdata(fd, &spk->id, spk->adt);
                        
-                       spk->sound= newlibadr(fd, spk->id.lib, spk->sound);
-                       if (spk->sound) {
-                               spk->sound->id.us++;
-                       }
-                       
+                       spk->sound = newlibadr_us(fd, spk->id.lib, spk->sound);
                        spk->id.flag -= LIB_NEED_LINK;
                }
        }