diff options
Diffstat (limited to 'source/blender/render/intern/raytrace/rayobject_vbvh.cpp')
-rw-r--r-- | source/blender/render/intern/raytrace/rayobject_vbvh.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp index 1765f3da381..25eada43a4a 100644 --- a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp +++ b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp @@ -98,13 +98,17 @@ void bvh_done<VBVHTree>(VBVHTree *obj) return; } - reorganize(root); - remove_useless(root, &root); - bvh_refit(root); - - pushup(root); - pushdown(root); - obj->root = root; + if(root) { + reorganize(root); + remove_useless(root, &root); + bvh_refit(root); + + pushup(root); + pushdown(root); + obj->root = root; + } + else + obj->root = NULL; } else { |