File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
objectbox-java/src/main/java/io/objectbox Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ public static boolean isSyncServerAvailable() {
221
221
private final File directory ;
222
222
private final String canonicalPath ;
223
223
/** Reference to the native store. Should probably get through {@link #getNativeStore()} instead. */
224
- private final long handle ;
224
+ private long handle ;
225
225
private final Map <Class <?>, String > dbNameByClass = new HashMap <>();
226
226
private final Map <Class <?>, Integer > entityTypeIdByClass = new HashMap <>();
227
227
private final Map <Class <?>, EntityInfo <?>> propertiesByClass = new HashMap <>();
@@ -626,7 +626,9 @@ public void close() {
626
626
}
627
627
if (handle != 0 ) { // failed before native handle was created?
628
628
nativeDelete (handle );
629
- // TODO set handle to 0 and check in native methods
629
+ // The Java API has open checks, but just in case re-set the handle so any native methods will
630
+ // not crash due to an invalid pointer.
631
+ handle = 0 ;
630
632
}
631
633
632
634
// When running the full unit test suite, we had 100+ threads before, hope this helps:
You can’t perform that action at this time.
0 commit comments