Skip to content

Commit

Permalink
Merge pull request #3 from assetninja/msvc
Browse files Browse the repository at this point in the history
discard tx on commit/abort in case of an error too
  • Loading branch information
hoytech authored Jul 23, 2020
2 parents e42e157 + 76c7635 commit 8b443d4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lmdb++.h
Original file line number Diff line number Diff line change
Expand Up @@ -1208,8 +1208,9 @@ class lmdb::txn {
* @post `handle() == nullptr`
*/
void commit() {
lmdb::txn_commit(_handle);
auto h = _handle;
_handle = nullptr;
lmdb::txn_commit(h);
}

/**
Expand All @@ -1218,8 +1219,9 @@ class lmdb::txn {
* @post `handle() == nullptr`
*/
void abort() noexcept {
lmdb::txn_abort(_handle);
auto h = _handle;
_handle = nullptr;
lmdb::txn_abort(h);
}

/**
Expand Down

0 comments on commit 8b443d4

Please sign in to comment.