File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,13 @@ ScopedTemporaryFile::ScopedTemporaryFile() {
16
16
17
17
ScopedTemporaryFile::~ScopedTemporaryFile () {
18
18
if (!path_.empty ()) {
19
- // On Windows calling base::DeleteFile on exit will call an API that would
20
- // halt the program, so we have to call the win32 API directly.
19
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
20
+ // On Windows it is very likely the file is already in use (because it is
21
+ // mostly used for Node native modules), so deleting it now will halt the
22
+ // program.
21
23
#if defined(OS_WIN)
22
- ::DeleteFile (path_.value().c_str() );
24
+ base::DeleteFileAfterReboot (path_);
23
25
#else
24
- base::ThreadRestrictions::ScopedAllowIO allow_io;
25
26
base::DeleteFile (path_, false );
26
27
#endif
27
28
}
You can’t perform that action at this time.
0 commit comments