End the read transaction after schema init
This commit is contained in:
parent
f780342851
commit
e53a534384
|
@ -171,6 +171,13 @@ SharedRealm Realm::get_shared_realm(Config config)
|
||||||
else {
|
else {
|
||||||
realm->update_schema(std::move(target_schema), target_schema_version);
|
realm->update_schema(std::move(target_schema), target_schema_version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!m_config.read_only) {
|
||||||
|
// End the read transaction created to validation/update the
|
||||||
|
// schema to avoid pinning the version even if the user never
|
||||||
|
// actually reads data
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,6 +88,7 @@ namespace realm {
|
||||||
void commit_transaction();
|
void commit_transaction();
|
||||||
void cancel_transaction();
|
void cancel_transaction();
|
||||||
bool is_in_transaction() const { return m_in_transaction; }
|
bool is_in_transaction() const { return m_in_transaction; }
|
||||||
|
bool is_in_read_transaction() const { return !!m_group; }
|
||||||
|
|
||||||
bool refresh();
|
bool refresh();
|
||||||
void set_auto_refresh(bool auto_refresh) { m_auto_refresh = auto_refresh; }
|
void set_auto_refresh(bool auto_refresh) { m_auto_refresh = auto_refresh; }
|
||||||
|
|
Loading…
Reference in New Issue