mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-26 22:39:05 +00:00
Fix the initial ref count for WeakRealmNotifier
Adding the run loop source to the run loop retains it, so the initial refcount should be 0, not 1.
This commit is contained in:
parent
d0763d541e
commit
273db05605
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user