Fix T46807: image/clip/sound load has one user
Loading data from Python gave it one user (unlike 'new' which has zero).
This commit is contained in:
parent
0639ba8ea5
commit
24a387d6ff
Notes:
blender-bot
2023-02-14 08:25:20 +01:00
Referenced by issue #46807, bpy.data.images.load gives the image one user
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue