Skip to content

Commit 130dcfb

Browse files
author
Qi Chen
committed
avoid dataset incblock leak
1 parent 2bc00ca commit 130dcfb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

AnnService/inc/Core/Common/Dataset.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,15 @@ namespace SPTAG
260260
{
261261
if (data != nullptr) {
262262
if (ownData) ALIGN_FREE(data);
263-
for (char* ptr : *incBlocks) ALIGN_FREE(ptr);
264-
incBlocks->clear();
265263
}
266-
267264
rows = rows_;
265+
266+
267+
for (char *ptr : *incBlocks)
268+
ALIGN_FREE(ptr);
269+
incBlocks->clear();
268270
incRows = 0;
271+
269272
if (rowEnd_ >= colStart_) cols = rowEnd_;
270273
else cols = cols_ * sizeof(T);
271274
data = (char*)data_;

0 commit comments

Comments
 (0)