Skip to content

Commit

Permalink
Fixing memory leak in TemporaryFileSystem
Browse files Browse the repository at this point in the history
Fixes #1679

Added logic to remove the ShutdownHook that
TemporaryFileSystem was injecting for cleaning up
temporary files created by Selenium, after the cleanup
was completed.

Signed-off-by: Luke Inman-Semerau <luke.semerau@gmail.com>
  • Loading branch information
krmahadevan authored and lukeis committed Feb 28, 2016
1 parent bfac5e3 commit 8ca0979
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ boolean shouldReap() {
}

public boolean deleteBaseDir() {
return baseDir.delete();
boolean wasDeleted = baseDir.delete();
if (! baseDir.exists()) {
Runtime.getRuntime().removeShutdownHook(shutdownHook);
}
return wasDeleted;
}
}

0 comments on commit 8ca0979

Please sign in to comment.