Skip to content

Commit 10b6821

Browse files
intorrXottab-DUTY
authored andcommitted
Fix Memory leak in xrCompress.
1 parent 1fc8dd7 commit 10b6821

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils/xrCompress/xrCompress.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ void xrCompressor::OpenPack(LPCSTR tgt_folder, int num)
339339
_unlink(fname);
340340
fs_pack_writer = FS.w_open(fname);
341341
fs_desc.clear();
342-
aliases.clear();
343342

344343
bytesSRC = 0;
345344
bytesDST = 0;
@@ -419,6 +418,10 @@ void xrCompressor::ClosePack()
419418
100.f * float(bytesDST) / float(bytesSRC), ((dwTimeEnd - dwTimeStart) / 1000) / 60,
420419
((dwTimeEnd - dwTimeStart) / 1000) % 60,
421420
float((float(bytesDST) / float(1024 * 1024)) / (t_compress.GetElapsed_sec())));
421+
422+
for (auto &it : aliases)
423+
xr_free(it.second.path);
424+
aliases.clear();
422425
}
423426

424427
void xrCompressor::PerformWork()

0 commit comments

Comments
 (0)