diff options
author | Julian Eisel <julian@blender.org> | 2020-12-04 21:43:33 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-12-04 22:00:45 +0300 |
commit | 3daf28388b7372208cbec870f51b37be3aeac1e9 (patch) | |
tree | c4641fa492499eb355c4c37c8418f4d0791c3c66 /source/blender/editors/space_outliner/space_outliner.c | |
parent | f5eaf67e34df088a2f0a19c744be7f8a51e7d9be (diff) |
Cleanup: Move Outliner runtime hash into internal runtime struct, out of DNA
This way Outliner internal data stays internal, non-Outliner code will not be
able to access and mess with this. Further it allows us to use the real type
(rather than `void *`), change the type to a C++ container if needed and
slightly reduces the size for every Outliner stored in files.
Slightly changed how we set the `SO_TREESTORE_REBUILD` for this, but it should
effectively behave the same way as before.
Diffstat (limited to 'source/blender/editors/space_outliner/space_outliner.c')
-rw-r--r-- | source/blender/editors/space_outliner/space_outliner.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index cd8e8a0be98..3c6369d3090 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -349,12 +349,12 @@ static void outliner_free(SpaceLink *sl) if (space_outliner->treestore) { BLI_mempool_destroy(space_outliner->treestore); } - if (space_outliner->treehash) { - BKE_outliner_treehash_free(space_outliner->treehash); - } if (space_outliner->runtime) { outliner_tree_display_destroy(&space_outliner->runtime->tree_display); + if (space_outliner->runtime->treehash) { + BKE_outliner_treehash_free(space_outliner->runtime->treehash); + } MEM_freeN(space_outliner->runtime); } } @@ -377,13 +377,13 @@ static SpaceLink *outliner_duplicate(SpaceLink *sl) BLI_listbase_clear(&space_outliner_new->tree); space_outliner_new->treestore = NULL; - space_outliner_new->treehash = NULL; space_outliner_new->sync_select_dirty = WM_OUTLINER_SYNC_SELECT_FROM_ALL; if (space_outliner->runtime) { space_outliner_new->runtime = MEM_dupallocN(space_outliner->runtime); space_outliner_new->runtime->tree_display = NULL; + space_outliner_new->runtime->treehash = NULL; } return (SpaceLink *)space_outliner_new; @@ -414,7 +414,7 @@ static void outliner_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, ID *old_i changed = true; } } - if (space_outliner->treehash && changed) { + if (space_outliner->runtime->treehash && changed) { /* rebuild hash table, because it depends on ids too */ /* postpone a full rebuild because this can be called many times on-free */ space_outliner->storeflag |= SO_TREESTORE_REBUILD; |