[Bf-blender-cvs] [24a387d] master: Fix T46807: image/clip/sound load has one user
Campbell Barton
noreply at git.blender.org
Wed Nov 18 20:30:32 CET 2015
Commit: 24a387d6ff515abcf47d7ad61d4faa9a589bd1a9
Author: Campbell Barton
Date: Thu Nov 19 06:20:02 2015 +1100
Branches: master
https://developer.blender.org/rB24a387d6ff515abcf47d7ad61d4faa9a589bd1a9
Fix T46807: image/clip/sound load has one user
Loading data from Python gave it one user (unlike 'new' which has zero).
===================================================================
M source/blender/makesrna/intern/rna_main_api.c
===================================================================
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 710ae97..de12257 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -369,6 +369,7 @@ static Image *rna_Main_images_load(Main *bmain, ReportList *reports, const char
errno ? strerror(errno) : TIP_("unsupported image format"));
}
+ id_us_min((ID *)ima);
return ima;
}
static void rna_Main_images_remove(Main *bmain, ReportList *reports, PointerRNA *image_ptr)
@@ -457,6 +458,7 @@ static VFont *rna_Main_fonts_load(Main *bmain, ReportList *reports, const char *
BKE_reportf(reports, RPT_ERROR, "Cannot read '%s': %s", filepath,
errno ? strerror(errno) : TIP_("unsupported font format"));
+ id_us_min((ID *)font);
return font;
}
@@ -710,6 +712,7 @@ static MovieClip *rna_Main_movieclip_load(Main *bmain, ReportList *reports, cons
BKE_reportf(reports, RPT_ERROR, "Cannot read '%s': %s", filepath,
errno ? strerror(errno) : TIP_("unable to load movie clip"));
+ id_us_min((ID *)clip);
return clip;
}
More information about the Bf-blender-cvs
mailing list