block refresh until the last context has finished execution

This commit is contained in:
Ari Lazier 2015-11-16 11:16:09 -08:00
parent e4732994b7
commit 85286b8807
2 changed files with 10 additions and 2 deletions

View File

@ -287,8 +287,6 @@ void Realm::cancel_transaction()
void Realm::invalidate()
{
verify_thread();
check_read_write(this);
if (m_in_transaction) {
cancel_transaction();
}
@ -384,6 +382,10 @@ void Realm::close()
m_notifier->remove_realm(this);
}
if (m_group) {
m_shared_group->end_read();
}
m_group = nullptr;
m_shared_group = nullptr;
m_history = nullptr;

View File

@ -197,6 +197,12 @@ namespace realm {
public:
UnitializedRealmException(std::string message) : std::runtime_error(message) {}
};
class ClosedRealmException : public std::runtime_error
{
public:
ClosedRealmException(std::string message) : std::runtime_error(message) {}
};
}
#endif /* defined(REALM_REALM_HPP) */