From: Cheng Zhao Date: Thu, 28 Jan 2016 14:38:53 +0000 (+0800) Subject: win: Call _close before close file handle X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=516b01e398c27ec714e74a5ce10d5a37f01e774d;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git win: Call _close before close file handle Fix #4258. --- diff --git a/atom/common/asar/archive.cc b/atom/common/asar/archive.cc index d6abf1c..7527932 100644 --- a/atom/common/asar/archive.cc +++ b/atom/common/asar/archive.cc @@ -130,14 +130,16 @@ Archive::Archive(const base::FilePath& path) Archive::~Archive() { #if defined(OS_WIN) - file_.Close(); - _close(fd_); + if (fd_ != -1) + _close(fd_); #endif } bool Archive::Init() { - if (!file_.IsValid()) + if (!file_.IsValid()) { + LOG(ERROR) << base::File::ErrorToString(file_.error_details()); return false; + } std::vector buf; int len;