Fix (unreported) missing Image usercount increase when copying UVProject modifier.
authorBastien Montagne <montagne29@wanadoo.fr>
Mon, 19 Jun 2017 13:05:08 +0000 (15:05 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Tue, 20 Jun 2017 11:46:09 +0000 (13:46 +0200)
source/blender/modifiers/intern/MOD_uvproject.c

index 78dc1ea8bcb2968b821c2ceee96ade28f7f62cb5..01468c1143a951b201b0aac29f3aa57f23b749cb 100644 (file)
@@ -45,6 +45,7 @@
 
 
 #include "BKE_camera.h"
+#include "BKE_library.h"
 #include "BKE_library_query.h"
 #include "BKE_mesh.h"
 #include "BKE_DerivedMesh.h"
@@ -70,9 +71,12 @@ static void copyData(ModifierData *md, ModifierData *target)
 {
 #if 0
        UVProjectModifierData *umd = (UVProjectModifierData *) md;
-       UVProjectModifierData *tumd = (UVProjectModifierData *) target;
 #endif
+       UVProjectModifierData *tumd = (UVProjectModifierData *) target;
+
        modifier_copyData_generic(md, target);
+
+       id_us_plus((ID *)tumd->image);
 }
 
 static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *UNUSED(md))