diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-01-14 23:08:22 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-01-15 13:09:16 +0300 |
commit | f55a178db06d6c3bf06ae8c33525d6d1c48c9572 (patch) | |
tree | fba4c8a2de5505c0363ebcdbc4b9644b9c975889 /source/blender/blenkernel/intern/library_remap.c | |
parent | f52d315c353f74d395f63c85ccd0a1659e929bd5 (diff) |
Cleanup: rename BKE_libblock_free_us to BKE_id_free_us.
Diffstat (limited to 'source/blender/blenkernel/intern/library_remap.c')
-rw-r--r-- | source/blender/blenkernel/intern/library_remap.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c index 2ee4e2890a1..cc7967a9bdd 100644 --- a/source/blender/blenkernel/intern/library_remap.c +++ b/source/blender/blenkernel/intern/library_remap.c @@ -811,6 +811,11 @@ void BKE_libblock_free_datablock(ID *id, const int UNUSED(flag)) * Complete ID freeing, extended version for corner cases. * Can override default (and safe!) freeing process, to gain some speed up. * + * At that point, given id is assumed to not be used by any other data-block already + * (might not be actually true, in case e.g. several inter-related IDs get freed together...). + * However, they might still be using (referencing) other IDs, this code takes care of it if + * \a LIB_TAG_NO_USER_REFCOUNT is not defined. + * * \param bmain Main database containing the freed ID, can be NULL in case it's a temp ID outside of any Main. * \param idv Pointer to ID to be freed. * \param flag Set of \a LIB_ID_FREE_... flags controlling/overriding usual freeing process, @@ -904,6 +909,8 @@ void BKE_id_free_ex(Main *bmain, void *idv, int flag, const bool use_flag_from_i /** * Complete ID freeing, should be usable in most cases (even for out-of-Main IDs). * + * See #BKE_id_free_ex description for full details. + * * \param bmain Main database containing the freed ID, can be NULL in case it's a temp ID outside of any Main. * \param idv Pointer to ID to be freed. */ @@ -912,7 +919,10 @@ void BKE_id_free(Main *bmain, void *idv) BKE_id_free_ex(bmain, idv, 0, true); } -void BKE_libblock_free_us(Main *bmain, void *idv) /* test users */ +/** + * Not really a freeing function by itself, it decrements usercount of given id, and only frees it if it reaches 0. + */ +void BKE_id_free_us(Main *bmain, void *idv) /* test users */ { ID *id = idv; |