From 08dd1a41be9afd497a166648f963bcd77146ecd0 Mon Sep 17 00:00:00 2001 From: Ari Lazier Date: Tue, 14 Jun 2016 14:36:27 -0700 Subject: [PATCH] always invalidate newly opened realms --- src/object-store/src/shared_realm.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/object-store/src/shared_realm.cpp b/src/object-store/src/shared_realm.cpp index 516d2360..3d603225 100644 --- a/src/object-store/src/shared_realm.cpp +++ b/src/object-store/src/shared_realm.cpp @@ -179,13 +179,13 @@ void Realm::init(std::shared_ptr 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 (...) {