[java] Fixing file stream leaking in legacy Firefox driver
@@ -100,7 +100,6 @@ private XpiDriverService(
} else if ("/dev/null".equals(firefoxLogFile)) {
sendOutputTo(ByteStreams.nullOutputStream());
} else {
- // TODO: This stream is leaked.
sendOutputTo(new FileOutputStream(firefoxLogFile));
}
} else {
@@ -239,16 +238,9 @@ protected void waitUntilAvailable() throws MalformedURLException {
@Override
public void stop() {
- lock.lock();
- try {
- if (process != null) {
- process.destroy();
- }
+ super.stop();
profile.cleanTemporaryModel();
profile.clean(profileDir);
- } finally {
- lock.unlock();
- }
}
private void addWebDriverExtension(FirefoxProfile profile) {
