From 80904e36e1ae993597084f85a980b31bbd1b5658 Mon Sep 17 00:00:00 2001 From: Ari Lazier Date: Fri, 13 May 2016 14:15:34 -0700 Subject: [PATCH] hopeful fix for android test --- src/impl/realm_coordinator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/impl/realm_coordinator.cpp b/src/impl/realm_coordinator.cpp index 3c624c32..f9c1c38a 100644 --- a/src/impl/realm_coordinator.cpp +++ b/src/impl/realm_coordinator.cpp @@ -64,6 +64,9 @@ std::shared_ptr RealmCoordinator::get_existing_coordinator(Str std::shared_ptr RealmCoordinator::get_realm(Realm::Config config) { std::lock_guard lock(m_realm_mutex); + + auto realm = std::make_shared(std::move(config)); + if ((!m_config.read_only && !m_notifier) || (m_config.read_only && m_weak_realm_notifiers.empty())) { m_config = config; if (!config.read_only && !m_notifier && config.automatic_change_notifications) { @@ -111,7 +114,6 @@ std::shared_ptr RealmCoordinator::get_realm(Realm::Config config) } } - auto realm = std::make_shared(std::move(config)); realm->init(shared_from_this()); m_weak_realm_notifiers.emplace_back(realm, m_config.cache); return realm;