win: Don't close the handle since we already closed the fd
authorCheng Zhao <zcbenz@gmail.com>
Sat, 30 Jan 2016 03:47:22 +0000 (11:47 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Sat, 30 Jan 2016 03:47:22 +0000 (11:47 +0800)
Fix #4266.

atom/common/asar/archive.cc

index 7527932..37ff0f4 100644 (file)
@@ -130,8 +130,11 @@ Archive::Archive(const base::FilePath& path)
 
 Archive::~Archive() {
 #if defined(OS_WIN)
-  if (fd_ != -1)
+  if (fd_ != -1) {
     _close(fd_);
+    // Don't close the handle since we already closed the fd.
+    file_.TakePlatformFile();
+  }
 #endif
 }