mirror of https://gitee.com/bigwinds/arangodb
fix memleak
This commit is contained in:
parent
27e4b170cf
commit
bd6d48760c
|
@ -106,13 +106,13 @@ void GeoIndexIterator::nextBabies(std::vector<IndexLookupResult>& result, size_t
|
||||||
result.clear();
|
result.clear();
|
||||||
if (batchSize > 0) {
|
if (batchSize > 0) {
|
||||||
auto coords = std::unique_ptr<GeoCoordinates>(::GeoIndex_ReadCursor(_cursor,batchSize));
|
auto coords = std::unique_ptr<GeoCoordinates>(::GeoIndex_ReadCursor(_cursor,batchSize));
|
||||||
|
|
||||||
size_t length = coords ? coords->length : 0;
|
size_t length = coords ? coords->length : 0;
|
||||||
//LOG_TOPIC(DEBUG, Logger::DEVEL) << "length " << length;
|
//LOG_TOPIC(DEBUG, Logger::DEVEL) << "length " << length;
|
||||||
if (!length){
|
if (!length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for(std::size_t index = 0; index < length; ++index){
|
for(std::size_t index = 0; index < length; ++index){
|
||||||
//LOG_TOPIC(DEBUG, Logger::DEVEL) << "near " << _near << " max allowed range: " << _withinRange
|
//LOG_TOPIC(DEBUG, Logger::DEVEL) << "near " << _near << " max allowed range: " << _withinRange
|
||||||
// << " actual range: " << GeoIndex_distance(&_coor, &coords->coordinates[index]) ;
|
// << " actual range: " << GeoIndex_distance(&_coor, &coords->coordinates[index]) ;
|
||||||
|
|
|
@ -180,4 +180,16 @@ friend class GeoIndexIterator;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace std {
|
||||||
|
template <>
|
||||||
|
class default_delete<GeoCoordinates> {
|
||||||
|
public:
|
||||||
|
void operator()(GeoCoordinates* result) {
|
||||||
|
if (result != nullptr) {
|
||||||
|
GeoIndex_CoordinatesFree(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue