提交 d1a3d528 编写于 作者: H Han Hu

fix constructor and deconstructor of the KDTreeIndex::Node. This will cause...

fix constructor and deconstructor of the KDTreeIndex::Node. This will cause the serialization work incorrectly in the case of the debug version and when the child pointer is not initialized as NULL automatically.

Because in saving node, serilazation relies on leaf_node = ((child1==NULL) && (child2==NULL)) to determine whether it's leaf or not.
上级 6f1d8f80
......@@ -299,15 +299,19 @@ private:
* Point data
*/
ElementType* point;
/**
* The child nodes.
*/
Node* child1, * child2;
~Node() {
if (child1!=NULL) child1->~Node();
if (child2!=NULL) child2->~Node();
}
/**
* The child nodes.
*/
Node* child1, *child2;
Node(){
child1 = NULL;
child2 = NULL;
}
~Node() {
if (child1 != NULL) { child1->~Node(); child1 = NULL; }
if (child2 != NULL) { child2->~Node(); child2 = NULL; }
}
private:
template<typename Archive>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册