Merge pull request #64 from realm/tg/leak

Fix the initial ref count for WeakRealmNotifier
This commit is contained in:
Thomas Goyne 2016-05-10 11:55:06 -07:00
commit c07fb9c963
1 changed files with 1 additions and 1 deletions

View File

@ -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();