Fix T49722: Appending Bug (Groups).

One day we'll have to reconsider why some many 'real' ID usages are not
refcounting... :(

To be backported to 2.78a.
This commit is contained in:
Bastien Montagne 2016-10-17 14:49:35 +02:00 committed by Sergey Sharybin
parent 50751d62e9
commit 44372d6441
1 changed files with 6 additions and 0 deletions

View File

@ -1714,6 +1714,12 @@ void BKE_library_make_local(Main *bmain, const Library *lib, const bool untagged
if (id->newid) {
bool is_local = false, is_lib = false;
/* Special hack for groups... Thing is, since we can't instantiate them here, we need to ensure
* they remain 'alive' (only instantiation is a real group 'user'... *sigh* See T49722. */
if (GS(id->name) == ID_GR && (id->tag & LIB_TAG_INDIRECT) != 0) {
id_us_ensure_real(id->newid);
}
BKE_library_ID_test_usages(bmain, id, &is_local, &is_lib);
if (!is_local && !is_lib) {
BKE_libblock_free(bmain, id);