always invalidate newly opened realms

This commit is contained in:
Ari Lazier 2016-06-14 14:36:27 -07:00
parent 81a32909c1
commit 08dd1a41be

View File

@ -179,15 +179,15 @@ void Realm::init(std::shared_ptr<RealmCoordinator> coordinator)
else { else {
update_schema(std::move(target_schema), target_schema_version); update_schema(std::move(target_schema), target_schema_version);
} }
}
if (!m_config.read_only) {
// End the read transaction created to validation/update the // End the read transaction created to validation/update the
// schema to avoid pinning the version even if the user never // schema to avoid pinning the version even if the user never
// actually reads data // actually reads data
if (!m_config.read_only) {
invalidate(); invalidate();
} }
} }
}
catch (...) { catch (...) {
// Trying to unregister from the coordinator before we finish // Trying to unregister from the coordinator before we finish
// construction will result in a deadlock // construction will result in a deadlock