mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
win: Fix program not quitting, close #1084
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user