Don't cache dynamic realms in the ObjectStore cache either

This commit is contained in:
Thomas Goyne 2015-08-26 11:32:13 -07:00 committed by Ari Lazier
parent 06ce25053d
commit c6d82ad436
2 changed files with 5 additions and 2 deletions

View File

@ -29,7 +29,7 @@ using namespace realm;
RealmCache Realm::s_global_cache; 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) { if (c.schema) {
schema = std::make_unique<Schema>(*c.schema); schema = std::make_unique<Schema>(*c.schema);
@ -132,7 +132,9 @@ SharedRealm Realm::get_shared_realm(Config &config)
realm->update_schema(*realm->m_config.schema, realm->m_config.schema_version); realm->update_schema(*realm->m_config.schema, realm->m_config.schema_version);
} }
if (config.cache) {
s_global_cache.cache_realm(realm, realm->m_thread_id); s_global_cache.cache_realm(realm, realm->m_thread_id);
}
return realm; return realm;
} }

View File

@ -44,6 +44,7 @@ namespace realm {
std::string path; std::string path;
bool read_only = false; bool read_only = false;
bool in_memory = false; bool in_memory = false;
bool cache = true;
std::unique_ptr<char[]> encryption_key; std::unique_ptr<char[]> encryption_key;
std::unique_ptr<Schema> schema; std::unique_ptr<Schema> schema;