Skip to content

Commit

Permalink
Update TemporaryDirectory.php
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze authored Sep 7, 2020
1 parent 078b251 commit fb32d59
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/TemporaryDirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ protected function deleteDirectory(string $path): bool
}
}

/*
* By forcing a php garbage collection cycle using gc_collect_cycles() we can ensure
* that the rmdir does not fail due to files still being reserved in memory.
*/
gc_collect_cycles();

return rmdir($path);
Expand Down

0 comments on commit fb32d59

Please sign in to comment.