always invalidate newly opened realms

This commit is contained in:
Ari Lazier 2016-06-14 14:36:27 -07:00
parent 81a32909c1
commit 08dd1a41be
1 changed files with 6 additions and 6 deletions

View File

@ -179,13 +179,13 @@ void Realm::init(std::shared_ptr<RealmCoordinator> coordinator)
else {
update_schema(std::move(target_schema), target_schema_version);
}
}
if (!m_config.read_only) {
// End the read transaction created to validation/update the
// schema to avoid pinning the version even if the user never
// actually reads data
invalidate();
}
// End the read transaction created to validation/update the
// schema to avoid pinning the version even if the user never
// actually reads data
if (!m_config.read_only) {
invalidate();
}
}
catch (...) {