Skip to content

Commit

Permalink
Remove finalize method from Logfile
Browse files Browse the repository at this point in the history
The usage of the finalization mechanism is meanwhile deprecated.
We only need to add another call to close() in the LogAnalyzerThread.
Everything else should already close the Logfile appropriately.
  • Loading branch information
hannesbraun committed Sep 12, 2023
1 parent 70ceba9 commit 8d440fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 6 additions & 0 deletions src/main/java/rv/comm/rcssserver/LogAnalyzerThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ public void run()
processFrame();

callback.finished(logfile.getNumFrames());

try {
logfile.close();
} catch (IOException e) {
// Ignore exception
}
}

private void processFrame()
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/rv/comm/rcssserver/Logfile.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,6 @@ public void stepAnywhere(int frame) throws IOException
setCurrentFrame(frame);
}

@Override
protected void finalize() throws Throwable
{
super.finalize();
close();
}

@Override
public File getFile()
{
Expand Down

0 comments on commit 8d440fb

Please sign in to comment.