From e61833c26ec565b3360574b523515c3d2a645b5d Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Mon, 24 Aug 2015 13:16:31 -0700 Subject: [PATCH] Use NSDMIs for Realm --- src/object-store/shared_realm.cpp | 3 +-- src/object-store/shared_realm.hpp | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/object-store/shared_realm.cpp b/src/object-store/shared_realm.cpp index fa921fe7..df89301c 100644 --- a/src/object-store/shared_realm.cpp +++ b/src/object-store/shared_realm.cpp @@ -40,7 +40,7 @@ Realm::Config::Config(const Config& c) : path(c.path), read_only(c.read_only), i } } -Realm::Realm(Config &config) : m_config(config), m_thread_id(std::this_thread::get_id()), m_auto_refresh(true), m_in_transaction(false) +Realm::Realm(Config &config) : m_config(config) { try { if (config.read_only) { @@ -52,7 +52,6 @@ Realm::Realm(Config &config) : m_config(config), m_thread_id(std::this_thread::g SharedGroup::DurabilityLevel durability = config.in_memory ? SharedGroup::durability_MemOnly : SharedGroup::durability_Full; m_shared_group = std::make_unique(*m_history, durability, config.encryption_key.get()); - m_group = nullptr; } } catch (util::File::PermissionDenied const& ex) { diff --git a/src/object-store/shared_realm.hpp b/src/object-store/shared_realm.hpp index 31c0a79b..3ddfb5a5 100644 --- a/src/object-store/shared_realm.hpp +++ b/src/object-store/shared_realm.hpp @@ -100,9 +100,9 @@ namespace realm { Realm(Config &config); Config m_config; - std::thread::id m_thread_id; - bool m_in_transaction; - bool m_auto_refresh; + std::thread::id m_thread_id = std::this_thread::get_id(); + bool m_in_transaction = false; + bool m_auto_refresh = true; std::set m_notifications; void send_local_notifications(const std::string ¬ification); @@ -114,7 +114,7 @@ namespace realm { std::unique_ptr m_shared_group; std::unique_ptr m_read_only_group; - Group *m_group; + Group *m_group = nullptr; public: ExternalNotificationFunction m_external_notifier;