Skip to content

Commit

Permalink
Merge pull request #3 from Imskull/master
Browse files Browse the repository at this point in the history
fix: zip file is not closed after unzipping
  • Loading branch information
hokein committed Aug 31, 2015
2 parents 9ec6997 + f577372 commit 3adfd67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/zip_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ void UpdateFileTime(const std::string& file_path,

namespace zip {

ZipReader::~ZipReader() {
if (zip_file_)
unzClose(zip_file_);
}

ZipReader::EntryInfo::EntryInfo(const std::string& file_name_in_zip,
const unz_file_info& file_info)
: file_path(file_name_in_zip), raw_file_info(file_info),
Expand Down
2 changes: 1 addition & 1 deletion src/zip_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace zip {
class ZipReader {
public:
ZipReader() {}
~ZipReader() {}
~ZipReader();

// This class represents information of an entry (file or directory) in
// a zip file.
Expand Down

0 comments on commit 3adfd67

Please sign in to comment.