win: Fix program not quitting, close #1084
This commit is contained in:
parent
c6fabf8613
commit
27011ad0c8
1 changed files with 6 additions and 0 deletions
|
@ -16,8 +16,14 @@ ScopedTemporaryFile::ScopedTemporaryFile() {
|
||||||
|
|
||||||
ScopedTemporaryFile::~ScopedTemporaryFile() {
|
ScopedTemporaryFile::~ScopedTemporaryFile() {
|
||||||
if (!path_.empty()) {
|
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::ThreadRestrictions::ScopedAllowIO allow_io;
|
||||||
base::DeleteFile(path_, false);
|
base::DeleteFile(path_, false);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue