Merge pull request #65 from vibe-d/fix_eventfd_leak

Fix leaked eventfd in PosixEventDriverCore.
This commit is contained in:
Sönke Ludwig 2018-03-14 22:19:00 +01:00 committed by GitHub
commit 6262c48db3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -92,6 +92,7 @@ final class PosixEventDriver(Loop : PosixEventLoop) : EventDriver {
if (!m_loop) return;
m_files.dispose();
m_dns.dispose();
m_core.dispose();
m_loop.dispose();
m_loop = null;
}
@ -120,6 +121,12 @@ final class PosixEventDriverCore(Loop : PosixEventLoop, Timers : EventDriverTime
m_wakeupEvent = events.createInternal();
}
protected final void dispose()
{
m_events.releaseRef(m_wakeupEvent);
m_wakeupEvent = EventID.invalid;
}
@property size_t waiterCount() const { return m_loop.m_waiterCount + m_timers.pendingCount; }
final override ExitReason processEvents(Duration timeout)