diff --git a/atom/common/asar/scoped_temporary_file.cc b/atom/common/asar/scoped_temporary_file.cc index 76ae5cb94b1c..d7e4dabb9db7 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 } }