From: Cheng Zhao Date: Tue, 3 Feb 2015 00:09:35 +0000 (-0800) Subject: win: Fix program not quitting, close #1084 X-Git-Tag: v0.21.1~2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=27011ad0c85ea07946224677ed83b5613ab77c50;p=electron.git win: Fix program not quitting, close #1084 --- diff --git a/atom/common/asar/scoped_temporary_file.cc b/atom/common/asar/scoped_temporary_file.cc index 76ae5cb9..d7e4dabb 100644 --- a/atom/common/asar/scoped_temporary_file.cc +++ b/atom/common/asar/scoped_temporary_file.cc @@ -16,8 +16,14 @@ ScopedTemporaryFile::ScopedTemporaryFile() { ScopedTemporaryFile::~ScopedTemporaryFile() { if (!path_.empty()) { + // On Windows calling base::DeleteFile on exit will call an API that would + // halt the program, so we have to call the win32 API directly. +#if defined(OS_WIN) + ::DeleteFile(path_.value().c_str()); +#else base::ThreadRestrictions::ScopedAllowIO allow_io; base::DeleteFile(path_, false); +#endif } }