提交 c7075bcd 编写于 作者: T Thomas Köppe

Fix memory leaks in kmeans_index.h

上级 b8a442fd
......@@ -416,6 +416,7 @@ private:
Index* obj = static_cast<Index*>(ar.getObject());
if (Archive::is_loading::value) {
delete[] pivot;
pivot = new DistanceType[obj->veclen_];
}
ar & serialization::make_binary_object(pivot, obj->veclen_*sizeof(DistanceType));
......@@ -524,6 +525,7 @@ private:
node->variance = variance;
node->radius = radius;
delete node->pivot;
node->pivot = mean;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册