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{};
|
||||
ctx.info = new RefCountedWeakPointer{realm, {1}};
|
||||
ctx.info = new RefCountedWeakPointer{realm, {0}};
|
||||
ctx.perform = [](void* info) {
|
||||
if (auto realm = static_cast<RefCountedWeakPointer*>(info)->realm.lock()) {
|
||||
realm->notify();
|
||||
|
|
|
@ -247,6 +247,7 @@ void Realm::update_schema(std::unique_ptr<Schema> schema, uint64_t version)
|
|||
if (m_config.migration_function) {
|
||||
m_config.migration_function(old_realm, shared_from_this());
|
||||
}
|
||||
m_config.migration_function = nullptr;
|
||||
};
|
||||
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue