Browse Source

Closing asar file should be syncronous

Cheng Zhao 7 years ago
parent
commit
1072c75e38
1 changed files with 2 additions and 5 deletions
  1. 2 5
      atom/common/asar/archive.cc

+ 2 - 5
atom/common/asar/archive.cc

@@ -138,11 +138,8 @@ Archive::~Archive() {
     file_.TakePlatformFile();
   }
 #endif
-  base::PostTaskWithTraits(
-      FROM_HERE,
-      {base::MayBlock(), base::TaskPriority::BACKGROUND,
-       base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
-      base::Bind([](base::File file) { file.Close(); }, Passed(&file_)));
+  base::ThreadRestrictions::ScopedAllowIO allow_io;
+  file_.Close();
 }
 
 bool Archive::Init() {