Fix leaked eventfd in PosixEventDriverCore.
The leak occurred once per thread, which showed up in conjunction with DNS lookups in particular, as a thread is currently created for each lookup.
This commit is contained in:
parent
0044946413
commit
b6b32f4a49
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue