fix leaking realm
This commit is contained in:
parent
3b24a4270e
commit
7b3fa3bc42
|
@ -34,7 +34,7 @@ WeakRealmNotifier::WeakRealmNotifier(const std::shared_ptr<Realm>& realm, bool c
|
||||||
};
|
};
|
||||||
|
|
||||||
CFRunLoopSourceContext ctx{};
|
CFRunLoopSourceContext ctx{};
|
||||||
ctx.info = new RefCountedWeakPointer{realm, {1}};
|
ctx.info = new RefCountedWeakPointer{realm, {0}};
|
||||||
ctx.perform = [](void* info) {
|
ctx.perform = [](void* info) {
|
||||||
if (auto realm = static_cast<RefCountedWeakPointer*>(info)->realm.lock()) {
|
if (auto realm = static_cast<RefCountedWeakPointer*>(info)->realm.lock()) {
|
||||||
realm->notify();
|
realm->notify();
|
||||||
|
|
|
@ -247,6 +247,7 @@ void Realm::update_schema(std::unique_ptr<Schema> schema, uint64_t version)
|
||||||
if (m_config.migration_function) {
|
if (m_config.migration_function) {
|
||||||
m_config.migration_function(old_realm, shared_from_this());
|
m_config.migration_function(old_realm, shared_from_this());
|
||||||
}
|
}
|
||||||
|
m_config.migration_function = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue