Skip to content

Commit

Permalink
Merge branch 'fix-load-native-lib-for-static-methods' into 'dev'
Browse files Browse the repository at this point in the history
Regression: ensure native library is loaded in static methods

See merge request objectbox/objectbox-java!131
  • Loading branch information
greenrobot-team committed Jan 30, 2024
2 parents 7e5639c + ea6af86 commit 9a19029
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions objectbox-java/src/main/java/io/objectbox/BoxStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ public static boolean isDatabaseOpen(File directory) throws IOException {
*/
@Experimental
public static long sysProcMeminfoKb(String key) {
NativeLibraryLoader.ensureLoaded();
return nativeSysProcMeminfoKb(key);
}

Expand All @@ -475,6 +476,7 @@ public static long sysProcMeminfoKb(String key) {
*/
@Experimental
public static long sysProcStatusKb(String key) {
NativeLibraryLoader.ensureLoaded();
return nativeSysProcStatusKb(key);
}

Expand Down Expand Up @@ -720,6 +722,7 @@ public static boolean deleteAllFiles(File objectStoreDirectory) {
if (isFileOpen(canonicalPath)) {
throw new IllegalStateException("Cannot delete files: store is still open");
}
NativeLibraryLoader.ensureLoaded();
return nativeRemoveDbFiles(canonicalPath, true);
}

Expand Down

0 comments on commit 9a19029

Please sign in to comment.