From 1072c75e384878fd7d4f71edb7f72cba56e3ca46 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 3 Jan 2018 19:12:16 +0900 Subject: [PATCH] Closing asar file should be syncronous --- atom/common/asar/archive.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/atom/common/asar/archive.cc b/atom/common/asar/archive.cc index dadc84c8bd..84f9cd8dd5 100644 --- a/atom/common/asar/archive.cc +++ b/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() {