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() {
221221 private final File directory ;
222222 private final String canonicalPath ;
223223 /** Reference to the native store. Should probably get through {@link #getNativeStore()} instead. */
224- private final long handle ;
224+ private long handle ;
225225 private final Map <Class <?>, String > dbNameByClass = new HashMap <>();
226226 private final Map <Class <?>, Integer > entityTypeIdByClass = new HashMap <>();
227227 private final Map <Class <?>, EntityInfo <?>> propertiesByClass = new HashMap <>();
@@ -626,7 +626,9 @@ public void close() {
626626 }
627627 if (handle != 0 ) { // failed before native handle was created?
628628 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 ;
630632 }
631633
632634 // 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