Fixed memory leak error

This commit is contained in:
Dongryeol Lee
2008-05-02 16:49:00 +00:00
parent 1d04944736
commit c67c33e267
2 changed files with 17 additions and 13 deletions
+9 -7
View File
@@ -637,14 +637,16 @@ class DualtreeKde {
*/
void PreProcess(Tree *node) {
// initialize the center of expansions and bandwidth for
// series expansion
// Initialize the center of expansions and bandwidth for series
// expansion.
Vector bounding_box_center;
node->stat().Init(ka_);
node->bound().CalculateMidpoint
(node->stat().farfield_expansion_.get_center());
node->bound().CalculateMidpoint
(node->stat().local_expansion_.get_center());
node->bound().CalculateMidpoint(&bounding_box_center);
(node->stat().farfield_expansion_.get_center())->CopyValues
(bounding_box_center);
(node->stat().local_expansion_.get_center())->CopyValues
(bounding_box_center);
// initialize lower bound to 0
node->stat().mass_l_ = 0;
+8 -6
View File
@@ -855,13 +855,15 @@ class FastKde {
*/
void PreProcess(Tree *node) {
// initialize the center of expansions and bandwidth for
// series expansion
// Initialize the center of expansions and bandwidth for series
// expansion.
Vector bounding_box_center;
node->stat().Init(parameters_.ka_);
node->bound().CalculateMidpoint
(node->stat().farfield_expansion_.get_center());
node->bound().CalculateMidpoint
(node->stat().local_expansion_.get_center());
node->bound().CalculateMidpoint(&bounding_box_center);
(node->stat().farfield_expansion_.get_center())->CopyValues
(bounding_box_center);
(node->stat().local_expansion_.get_center())->CopyValues
(bounding_box_center);
// reset summary result and postponed information
node->stat().summary_result_.Init(parameters_);