Skip to content

Commit

Permalink
Don't cache dynamic realms in the ObjectStore cache either
Browse files Browse the repository at this point in the history
  • Loading branch information
tgoyne committed Sep 9, 2015
1 parent 25a6734 commit 0ae1bb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions shared_realm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ using namespace realm;

RealmCache Realm::s_global_cache;

Realm::Config::Config(const Config& c) : path(c.path), read_only(c.read_only), in_memory(c.in_memory), schema_version(c.schema_version), migration_function(c.migration_function)
Realm::Config::Config(const Config& c) : path(c.path), read_only(c.read_only), in_memory(c.in_memory), cache(c.cache), schema_version(c.schema_version), migration_function(c.migration_function)
{
if (c.schema) {
schema = std::make_unique<Schema>(*c.schema);
Expand Down Expand Up @@ -132,7 +132,9 @@ SharedRealm Realm::get_shared_realm(Config &config)
realm->update_schema(*realm->m_config.schema, realm->m_config.schema_version);
}

s_global_cache.cache_realm(realm, realm->m_thread_id);
if (config.cache) {
s_global_cache.cache_realm(realm, realm->m_thread_id);
}
return realm;
}

Expand Down
1 change: 1 addition & 0 deletions shared_realm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ namespace realm {
std::string path;
bool read_only = false;
bool in_memory = false;
bool cache = true;
std::unique_ptr<char[]> encryption_key;

std::unique_ptr<Schema> schema;
Expand Down

0 comments on commit 0ae1bb1

Please sign in to comment.