win: Fix program not quitting, close #1084

This commit is contained in:
Cheng Zhao 2015-02-02 16:09:35 -08:00
parent c6fabf8613
commit 27011ad0c8

View file

@ -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
}
}