Skip to content

Commit

Permalink
[HOTFIX] hotfix: didn't consider the case where native library is a s…
Browse files Browse the repository at this point in the history
…ymbolic link (oap-project#412)

hotfix: didn't consider the case where native library is a symbolic link (oap-project#412)
  • Loading branch information
binmahone authored Sep 29, 2022
1 parent c11d993 commit 3bef323
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,12 @@ public static synchronized void unloadAllNativeLibs() {

public static synchronized void unloadNativeLibs(String libName) {
LOADED_LIBRARY_PATHS.remove(libName);

try {
while (Files.isSymbolicLink(Paths.get(libName))) {
libName = Files.readSymbolicLink(Paths.get(libName)).toString();
}

ClassLoader classLoader = JniLibLoader.class.getClassLoader();
Field field = ClassLoader.class.getDeclaredField("nativeLibraries");
field.setAccessible(true);
Expand Down

0 comments on commit 3bef323

Please sign in to comment.