Read-only Realm should be opened even in immutable directory Realm files in an app bundle should be opened if marked as read-only
This commit is contained in:
parent
415bfe4d35
commit
0bae415718
|
@ -158,11 +158,15 @@ SharedRealm Realm::get_shared_realm(Config config)
|
||||||
// FIXME - need to validate that schemas match
|
// FIXME - need to validate that schemas match
|
||||||
realm->m_config.schema = std::make_unique<Schema>(*existing->m_config.schema);
|
realm->m_config.schema = std::make_unique<Schema>(*existing->m_config.schema);
|
||||||
|
|
||||||
|
if (!realm->m_config.read_only) {
|
||||||
realm->m_notifier = existing->m_notifier;
|
realm->m_notifier = existing->m_notifier;
|
||||||
realm->m_notifier->add_realm(realm.get());
|
realm->m_notifier->add_realm(realm.get());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
|
if (!realm->m_config.read_only) {
|
||||||
realm->m_notifier = std::make_shared<ExternalCommitHelper>(realm.get());
|
realm->m_notifier = std::make_shared<ExternalCommitHelper>(realm.get());
|
||||||
|
}
|
||||||
|
|
||||||
// otherwise get the schema from the group
|
// otherwise get the schema from the group
|
||||||
realm->m_config.schema = std::make_unique<Schema>(ObjectStore::schema_from_group(realm->read_group()));
|
realm->m_config.schema = std::make_unique<Schema>(ObjectStore::schema_from_group(realm->read_group()));
|
||||||
|
|
Loading…
Reference in New Issue