Skip to content

Commit

Permalink
Move deallocator to the right place
Browse files Browse the repository at this point in the history
  • Loading branch information
xxDark committed May 21, 2022
1 parent 59711d0 commit 0c34623
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/main/java/software/coley/llzip/util/BufferData.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ public void close() {
if (cleaned)
return;
cleaned = true;
}
ByteBuffer buffer = this.buffer;
if (buffer.isDirect()) {
CleanerUtil.invokeCleaner(buffer);
ByteBuffer buffer = this.buffer;
if (buffer.isDirect()) {
CleanerUtil.invokeCleaner(buffer);
}
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/software/coley/llzip/util/UnsafeMappedFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ public void close() {
if (cleaned)
return;
cleaned = true;
Runnable deallocator = this.deallocator;
if (deallocator != null)
deallocator.run();
}
}
Runnable deallocator = this.deallocator;
if (deallocator != null)
deallocator.run();
}

private void ensureOpen() {
Expand Down

0 comments on commit 0c34623

Please sign in to comment.