mirror of
https://github.com/status-im/realm-js.git
synced 2025-02-17 09:06:26 +00:00
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"
|
#include "shared_realm.hpp"
|
||||||
|
|
||||||
|
#if __APPLE__
|
||||||
#include "external_commit_helper.hpp"
|
#include "external_commit_helper.hpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "binding_context.hpp"
|
#include "binding_context.hpp"
|
||||||
#include "schema.hpp"
|
#include "schema.hpp"
|
||||||
#include "transact_log_handler.hpp"
|
#include "impl/transact_log_handler.hpp"
|
||||||
|
|
||||||
#include <realm/commit_log.hpp>
|
#include <realm/commit_log.hpp>
|
||||||
#include <realm/group_shared.hpp>
|
#include <realm/group_shared.hpp>
|
||||||
@ -101,9 +104,11 @@ Realm::Realm(Config config)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Realm::~Realm() {
|
Realm::~Realm() {
|
||||||
|
#if __APPLE__
|
||||||
if (m_notifier) { // might not exist yet if an error occurred during init
|
if (m_notifier) { // might not exist yet if an error occurred during init
|
||||||
m_notifier->remove_realm(this);
|
m_notifier->remove_realm(this);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Group *Realm::read_group()
|
Group *Realm::read_group()
|
||||||
@ -154,11 +159,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 __APPLE__
|
||||||
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());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
#if __APPLE__
|
||||||
realm->m_notifier = std::make_shared<ExternalCommitHelper>(realm.get());
|
realm->m_notifier = std::make_shared<ExternalCommitHelper>(realm.get());
|
||||||
|
#endif
|
||||||
|
|
||||||
// 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()));
|
||||||
@ -290,7 +299,9 @@ void Realm::commit_transaction()
|
|||||||
|
|
||||||
m_in_transaction = false;
|
m_in_transaction = false;
|
||||||
transaction::commit(*m_shared_group, *m_history, m_binding_context.get());
|
transaction::commit(*m_shared_group, *m_history, m_binding_context.get());
|
||||||
|
#if __APPLE__
|
||||||
m_notifier->notify_others();
|
m_notifier->notify_others();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Realm::cancel_transaction()
|
void Realm::cancel_transaction()
|
||||||
@ -398,15 +409,17 @@ uint64_t Realm::get_schema_version(const realm::Realm::Config &config)
|
|||||||
|
|
||||||
void Realm::close()
|
void Realm::close()
|
||||||
{
|
{
|
||||||
|
#if __APPLE__
|
||||||
if (m_notifier) {
|
if (m_notifier) {
|
||||||
m_notifier->remove_realm(this);
|
m_notifier->remove_realm(this);
|
||||||
}
|
}
|
||||||
|
m_notifier = nullptr;
|
||||||
|
#endif
|
||||||
|
|
||||||
m_group = nullptr;
|
m_group = nullptr;
|
||||||
m_shared_group = nullptr;
|
m_shared_group = nullptr;
|
||||||
m_history = nullptr;
|
m_history = nullptr;
|
||||||
m_read_only_group = nullptr;
|
m_read_only_group = nullptr;
|
||||||
m_notifier = nullptr;
|
|
||||||
m_binding_context = nullptr;
|
m_binding_context = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,8 +124,10 @@ namespace realm {
|
|||||||
|
|
||||||
Group *m_group = nullptr;
|
Group *m_group = nullptr;
|
||||||
|
|
||||||
|
#if __APPLE__
|
||||||
std::shared_ptr<_impl::ExternalCommitHelper> m_notifier;
|
std::shared_ptr<_impl::ExternalCommitHelper> m_notifier;
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::unique_ptr<BindingContext> m_binding_context;
|
std::unique_ptr<BindingContext> m_binding_context;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user