hopeful fix for android test

This commit is contained in:
Ari Lazier 2016-05-13 14:15:34 -07:00
parent 9c1b923797
commit 0ce3cdf81d
1 changed files with 3 additions and 1 deletions

View File

@ -64,6 +64,9 @@ std::shared_ptr<RealmCoordinator> RealmCoordinator::get_existing_coordinator(Str
std::shared_ptr<Realm> RealmCoordinator::get_realm(Realm::Config config) std::shared_ptr<Realm> RealmCoordinator::get_realm(Realm::Config config)
{ {
std::lock_guard<std::mutex> lock(m_realm_mutex); std::lock_guard<std::mutex> lock(m_realm_mutex);
auto realm = std::make_shared<Realm>(std::move(config));
if ((!m_config.read_only && !m_notifier) || (m_config.read_only && m_weak_realm_notifiers.empty())) { if ((!m_config.read_only && !m_notifier) || (m_config.read_only && m_weak_realm_notifiers.empty())) {
m_config = config; m_config = config;
if (!config.read_only && !m_notifier && config.automatic_change_notifications) { if (!config.read_only && !m_notifier && config.automatic_change_notifications) {
@ -111,7 +114,6 @@ std::shared_ptr<Realm> RealmCoordinator::get_realm(Realm::Config config)
} }
} }
auto realm = std::make_shared<Realm>(std::move(config));
realm->init(shared_from_this()); realm->init(shared_from_this());
m_weak_realm_notifiers.emplace_back(realm, m_config.cache); m_weak_realm_notifiers.emplace_back(realm, m_config.cache);
return realm; return realm;