Description
LiteCore: 0a5d8f1df282f3be60df3cf76c14a345db23c390
After using LiteCore C++ API to begin transaction on a closed c4Database which results expectedly to a NotOpen exception, there was an assertion failure later when the database was destructed.
Seem like _transactionLevel shouldn't be bumped if the transaction cannot begin.
Log:
error: Assertion failed: Database being destructed while in a transaction (DatabaseImpl.cc:294, in ~DatabaseImpl) |
0 libcblite.dylib litecore::DatabaseImpl::~DatabaseImpl() + 688 |
1 libcblite.dylib litecore::DatabaseImpl::~DatabaseImpl() + 84 |
2 libcblite.dylib litecore::DatabaseImpl::~DatabaseImpl() + 80 |
3 libcblite.dylib fleece::RefCounted::_careful_release() const + 500 |
4 libcblite.dylib fleece::RefCounted::_release() const + 80 |
5 libcblite.dylib fleece::release(fleece::RefCounted const*) + 92 |
6 libcblite.dylib fleece::Retained<C4Database>::~Retained() + 208 |
7 libcblite.dylib fleece::Retained<C4Database>::~Retained() + 84 |
8 libcblite.dylib litecore::access_lock<fleece::Retained<C4Database>, std::recursive_mutex>::~access_lock() + 100 |
9 libcblite.dylib CBLDatabase::C4DatabaseAccessLock::~C4DatabaseAccessLock() + 84 |
10 libcblite.dylib CBLDatabase::C4DatabaseAccessLock::~C4DatabaseAccessLock() + 84 |
11 libcblite.dylib std::__shared_ptr_emplace<CBLDatabase::C4DatabaseAccessLock, std::allocator<CBLDatabase::C4DatabaseAccessLock> >::__on_zero_shared() + 140 |
12 libcblite.dylib std::__shared_count::__release_shared() + 284 |
13 libcblite.dylib std::__shared_weak_count::__release_shared() + 116 |
14 libcblite.dylib std::shared_ptr<CBLDatabase::C4DatabaseAccessLock>::~shared_ptr() + 268 |
15 libcblite.dylib std::shared_ptr<CBLDatabase::C4DatabaseAccessLock>::~shared_ptr() + 84 |
16 libcblite.dylib CBLDatabase::~CBLDatabase() + 808 |
17 libcblite.dylib CBLDatabase::~CBLDatabase() + 84 |
18 libcblite.dylib CBLDatabase::~CBLDatabase() + 80 |
19 libcblite.dylib fleece::RefCounted::_careful_release() const + 500 |
20 libcblite.dylib fleece::RefCounted::_release() const + 80 |
21 libcblite.dylib fleece::release(fleece::RefCounted const*) + 92 |
22 libcblite.dylib CBL_Release |
Note: I have noticed this when testing CBL-C API.