Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 14 Jun 2017 08:48:20 +0000 (10:48 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 14 Jun 2017 08:48:20 +0000 (10:48 +0200)
1  2 
source/blender/blenkernel/BKE_library.h
source/blender/blenkernel/intern/library_remap.c

index be16e7ce448db370e6a3086c11259a680c9bfe91,668962cf6e411420421f94a96051ca45cfeb61a3..a5e8e41e738a2f99954b42dde0306beb4649e728
@@@ -890,10 -838,34 +869,37 @@@ void BKE_libblock_free_datablock(ID *id
                case ID_CF:
                        BKE_cachefile_free((CacheFile *)id);
                        break;
 +              case ID_WS:
 +                      BKE_workspace_free((WorkSpace *)id);
 +                      break;
        }
 -      DAG_id_type_tag(bmain, type);
+ }
+ /**
+  * used in headerbuttons.c image.c mesh.c screen.c sound.c and library.c
+  *
+  * \param do_id_user: if \a true, try to release other ID's 'references' hold by \a idv.
+  *                    (only applies to main database)
+  * \param do_ui_user: similar to do_id_user but makes sure UI does not hold references to
+  *                    \a id.
+  */
+ void BKE_libblock_free_ex(Main *bmain, void *idv, const bool do_id_user, const bool do_ui_user)
+ {
+       ID *id = idv;
+       short type = GS(id->name);
+       ListBase *lb = which_libbase(bmain, type);
++      DEG_id_type_tag(bmain, type);
+ #ifdef WITH_PYTHON
+       BPY_id_release(id);
+ #endif
+       if (do_id_user) {
+               BKE_libblock_relink_ex(bmain, id, NULL, NULL, true);
+       }
+       BKE_libblock_free_datablock(id);
  
        /* avoid notifying on removed data */
        BKE_main_lock(bmain);