diff options
author | Sv. Lockal <lockalsash@gmail.com> | 2013-08-03 15:35:09 +0400 |
---|---|---|
committer | Sv. Lockal <lockalsash@gmail.com> | 2013-08-03 15:35:09 +0400 |
commit | 66a40779271b55498216cc14b4df3ca8d575137c (patch) | |
tree | fdd0ed4df73ca2ecb9f3c58813e8338c53eedadb /source/blender/editors/space_outliner/space_outliner.c | |
parent | 91d148b8914bb198a78c3789fa39c2850d37d219 (diff) |
fix for [#36260] 2,300 Objects Makes Blender Unresponsive
- performance of outliner was low because of unoptimal data structures.
- now it uses BLI_mempool instead of custom mempool and GHash to make searches for duplicates faster.
- also fix undesired behaviour of BLI_mempool_as_arrayN
thanks to Campbell Barton and Lukas Tönne for helping me get a better fix put together.
Diffstat (limited to 'source/blender/editors/space_outliner/space_outliner.c')
-rw-r--r-- | source/blender/editors/space_outliner/space_outliner.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index 8da244b1db1..9c51265f917 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -37,6 +37,8 @@ #include "BLI_blenlib.h" #include "BLI_math.h" #include "BLI_utildefines.h" +#include "BLI_mempool.h" +#include "BLI_ghash.h" #include "BKE_context.h" #include "BKE_screen.h" @@ -426,10 +428,11 @@ static void outliner_free(SpaceLink *sl) outliner_free_tree(&soutliner->tree); if (soutliner->treestore) { - if (soutliner->treestore->data) MEM_freeN(soutliner->treestore->data); - MEM_freeN(soutliner->treestore); + BLI_mempool_destroy(soutliner->treestore); + } + if (soutliner->treehash) { + BLI_ghash_free(soutliner->treehash, NULL, NULL); } - } /* spacetype; init callback */ |