From 2857861023ac144274fd8b1f9f82777aac72462f Mon Sep 17 00:00:00 2001 From: Jiri Hnidek Date: Fri, 20 Apr 2007 12:56:51 +0000 Subject: Buf fix for #6571 - metaball_tree= NULL; was missing in code --- source/blender/blenkernel/intern/mball.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel/intern/mball.c') diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 2e1efed5b49..e731f0fdfe0 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -40,6 +40,7 @@ #include #include #include +#include #include "MEM_guardedalloc.h" #include "DNA_material_types.h" @@ -74,7 +75,7 @@ float thresh= 0.6f; int totelem=0; MetaElem **mainb; -octal_tree *metaball_tree; +octal_tree *metaball_tree = NULL; /* Functions */ void unlink_mball(MetaBall *mb) @@ -1918,7 +1919,7 @@ void free_metaball_octal_node(octal_node *node) if(node->nodes[a]!=NULL) free_metaball_octal_node(node->nodes[a]); } BLI_freelistN(&node->elems); - if(node) MEM_freeN(node); + MEM_freeN(node); } /* If scene include more then one MetaElem, then octree is used */ @@ -1944,8 +1945,8 @@ void init_metaball_octal_tree(int depth) for(a=0;a<8;a++) node->nodes[a]=NULL; - node->x_min= node->y_min= node->z_min= 10000000.0; - node->x_max= node->y_max= node->z_max= -10000000.0; + node->x_min= node->y_min= node->z_min= FLT_MAX; + node->x_max= node->y_max= node->z_max= -FLT_MAX; /* size of octal tree scene */ for(a=0;afirst); MEM_freeN(metaball_tree); + metaball_tree= NULL; } /* if scene includes more then one MetaElem, then octal tree optimalisation is used */ -- cgit v1.2.3