Skip to content

Commit 9a19029

Browse files
Merge branch 'fix-load-native-lib-for-static-methods' into 'dev'
Regression: ensure native library is loaded in static methods See merge request objectbox/objectbox-java!131
2 parents 7e5639c + ea6af86 commit 9a19029

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

objectbox-java/src/main/java/io/objectbox/BoxStore.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ public static boolean isDatabaseOpen(File directory) throws IOException {
453453
*/
454454
@Experimental
455455
public static long sysProcMeminfoKb(String key) {
456+
NativeLibraryLoader.ensureLoaded();
456457
return nativeSysProcMeminfoKb(key);
457458
}
458459

@@ -475,6 +476,7 @@ public static long sysProcMeminfoKb(String key) {
475476
*/
476477
@Experimental
477478
public static long sysProcStatusKb(String key) {
479+
NativeLibraryLoader.ensureLoaded();
478480
return nativeSysProcStatusKb(key);
479481
}
480482

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

0 commit comments

Comments
 (0)