Fix decrementing the waiter count when destroying a WinAPI event with active waiters.
This commit is contained in:
parent
fdeef38ef4
commit
3352423414
|
@ -110,6 +110,10 @@ final class WinAPIEventDriverEvents : EventDriverEvents {
|
||||||
auto pe = descriptor in m_events;
|
auto pe = descriptor in m_events;
|
||||||
assert(pe.refCount > 0);
|
assert(pe.refCount > 0);
|
||||||
if (--pe.refCount == 0) {
|
if (--pe.refCount == 0) {
|
||||||
|
// make sure to not leak any waiter references for pending waits
|
||||||
|
foreach (i; 0 .. pe.waiters.length)
|
||||||
|
m_core.removeWaiter();
|
||||||
|
|
||||||
() @trusted nothrow {
|
() @trusted nothrow {
|
||||||
scope (failure) assert(false);
|
scope (failure) assert(false);
|
||||||
destroy(pe.waiters);
|
destroy(pe.waiters);
|
||||||
|
|
Loading…
Reference in a new issue