diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-12-07 09:19:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-12-07 09:38:48 +0300 |
commit | ffc4c126f5416b04a01653e7a03451797b98aba4 (patch) | |
tree | ac63d70d33aae5ab1666c9c2f62058c9c1eebd5c /source/blender/blenkernel/BKE_main_idmap.h | |
parent | f159d49f56cedccd509ee93f5a5fb51f4f39eeb8 (diff) |
Cleanup: move public doc-strings into headers for 'blenkernel'
- Added space below non doc-string comments to make it clear
these aren't comments for the symbols directly below them.
- Use doxy sections for some headers.
- Minor improvements to doc-strings.
Ref T92709
Diffstat (limited to 'source/blender/blenkernel/BKE_main_idmap.h')
-rw-r--r-- | source/blender/blenkernel/BKE_main_idmap.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_main_idmap.h b/source/blender/blenkernel/BKE_main_idmap.h index ff69883f0fb..13ddcaa93ba 100644 --- a/source/blender/blenkernel/BKE_main_idmap.h +++ b/source/blender/blenkernel/BKE_main_idmap.h @@ -44,6 +44,17 @@ enum { MAIN_IDMAP_TYPE_UUID = 1 << 1, }; +/** + * Generate mapping from ID type/name to ID pointer for given \a bmain. + * + * \note When used during undo/redo, there is no guaranty that ID pointers from UI area are not + * pointing to freed memory (when some IDs have been deleted). To avoid crashes in those cases, one + * can provide the 'old' (aka current) Main database as reference. #BKE_main_idmap_lookup_id will + * then check that given ID does exist in \a old_bmain before trying to use it. + * + * \param create_valid_ids_set: If \a true, generate a reference to prevent freed memory accesses. + * \param old_bmain: If not NULL, its IDs will be added the valid references set. + */ struct IDNameLib_Map *BKE_main_idmap_create(struct Main *bmain, const bool create_valid_ids_set, struct Main *old_bmain, |