Skip to content

Commit

Permalink
Fix Memory leak in xrCompress.
Browse files Browse the repository at this point in the history
  • Loading branch information
intorr authored and Xottab-DUTY committed Dec 17, 2017
1 parent 1fc8dd7 commit 10b6821
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/xrCompress/xrCompress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ void xrCompressor::OpenPack(LPCSTR tgt_folder, int num)
_unlink(fname);
fs_pack_writer = FS.w_open(fname);
fs_desc.clear();
aliases.clear();

bytesSRC = 0;
bytesDST = 0;
Expand Down Expand Up @@ -419,6 +418,10 @@ void xrCompressor::ClosePack()
100.f * float(bytesDST) / float(bytesSRC), ((dwTimeEnd - dwTimeStart) / 1000) / 60,
((dwTimeEnd - dwTimeStart) / 1000) % 60,
float((float(bytesDST) / float(1024 * 1024)) / (t_compress.GetElapsed_sec())));

for (auto &it : aliases)
xr_free(it.second.path);
aliases.clear();
}

void xrCompressor::PerformWork()
Expand Down

0 comments on commit 10b6821

Please sign in to comment.