We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fcaf2a2 commit 327905bCopy full SHA for 327905b
objectbox/lib/src/box.dart
@@ -272,8 +272,12 @@ class Box<T> {
272
_inReadTransaction(fn) {
273
Pointer<Void> txn = bindings.obx_txn_read(_store.ptr);
274
checkObxPtr(txn, "failed to created transaction");
275
- var ret = fn();
276
- checkObx(bindings.obx_txn_close(txn));
+ var ret;
+ try {
277
+ ret = fn();
278
+ } finally {
279
+ checkObx(bindings.obx_txn_close(txn));
280
+ }
281
return ret;
282
}
283
0 commit comments