Merge pull request #64 from realm/tg/leak
Fix the initial ref count for WeakRealmNotifier
This commit is contained in:
commit
c07fb9c963
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue