just use one symlink to the binding source, make more stuff compile
This commit is contained in:
parent
ff532b47c4
commit
5e7a952f48
|
@ -18,10 +18,13 @@
|
|||
|
||||
#include "shared_realm.hpp"
|
||||
|
||||
#if __APPLE__
|
||||
#include "external_commit_helper.hpp"
|
||||
#endif
|
||||
|
||||
#include "binding_context.hpp"
|
||||
#include "schema.hpp"
|
||||
#include "transact_log_handler.hpp"
|
||||
#include "impl/transact_log_handler.hpp"
|
||||
|
||||
#include <realm/commit_log.hpp>
|
||||
#include <realm/group_shared.hpp>
|
||||
|
@ -101,9 +104,11 @@ Realm::Realm(Config config)
|
|||
}
|
||||
|
||||
Realm::~Realm() {
|
||||
#if __APPLE__
|
||||
if (m_notifier) { // might not exist yet if an error occurred during init
|
||||
m_notifier->remove_realm(this);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Group *Realm::read_group()
|
||||
|
@ -154,11 +159,15 @@ SharedRealm Realm::get_shared_realm(Config config)
|
|||
// FIXME - need to validate that schemas match
|
||||
realm->m_config.schema = std::make_unique<Schema>(*existing->m_config.schema);
|
||||
|
||||
#if __APPLE__
|
||||
realm->m_notifier = existing->m_notifier;
|
||||
realm->m_notifier->add_realm(realm.get());
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
#if __APPLE__
|
||||
realm->m_notifier = std::make_shared<ExternalCommitHelper>(realm.get());
|
||||
#endif
|
||||
|
||||
// otherwise get the schema from the group
|
||||
realm->m_config.schema = std::make_unique<Schema>(ObjectStore::schema_from_group(realm->read_group()));
|
||||
|
@ -290,7 +299,9 @@ void Realm::commit_transaction()
|
|||
|
||||
m_in_transaction = false;
|
||||
transaction::commit(*m_shared_group, *m_history, m_binding_context.get());
|
||||
#if __APPLE__
|
||||
m_notifier->notify_others();
|
||||
#endif
|
||||
}
|
||||
|
||||
void Realm::cancel_transaction()
|
||||
|
@ -398,15 +409,17 @@ uint64_t Realm::get_schema_version(const realm::Realm::Config &config)
|
|||
|
||||
void Realm::close()
|
||||
{
|
||||
#if __APPLE__
|
||||
if (m_notifier) {
|
||||
m_notifier->remove_realm(this);
|
||||
}
|
||||
m_notifier = nullptr;
|
||||
#endif
|
||||
|
||||
m_group = nullptr;
|
||||
m_shared_group = nullptr;
|
||||
m_history = nullptr;
|
||||
m_read_only_group = nullptr;
|
||||
m_notifier = nullptr;
|
||||
m_binding_context = nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -124,8 +124,10 @@ namespace realm {
|
|||
|
||||
Group *m_group = nullptr;
|
||||
|
||||
#if __APPLE__
|
||||
std::shared_ptr<_impl::ExternalCommitHelper> m_notifier;
|
||||
|
||||
#endif
|
||||
|
||||
public:
|
||||
std::unique_ptr<BindingContext> m_binding_context;
|
||||
|
||||
|
|
Loading…
Reference in New Issue