Skip to content

Commit

Permalink
Ensure propagation of handle invalidation of native library on manual…
Browse files Browse the repository at this point in the history
… unload

Reported by: @sebbASF
Closes: #1561
  • Loading branch information
matthiasblaesing committed Dec 4, 2023
1 parent 458adcf commit 7775be3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/com/sun/jna/NativeLibrary.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ public long getSymbolAddress(long handle, String name, SymbolProvider parent) {
}
};

private Cleaner.Cleanable cleanable;
private long handle;
private final Cleaner.Cleanable cleanable;
private volatile long handle;
private final String libraryName;
private final String libraryPath;
private final Map<String, Function> functions = new HashMap<>();
Expand Down Expand Up @@ -701,8 +701,8 @@ public void close() {

synchronized(this) {
if (handle != 0) {
cleanable.clean();
handle = 0;
cleanable.clean();
}
}
}
Expand Down

0 comments on commit 7775be3

Please sign in to comment.