From ac4aec341e017c77c6844ad6c1c080ea9ef86d37 Mon Sep 17 00:00:00 2001 From: Andrej Mitrovic Date: Tue, 18 Aug 2020 17:49:54 +0900 Subject: [PATCH] dns: Set the result to null in cancelLookup() When lookupHost() is called the handle returned from allocateHandle() might be a reused handle. The delegate will be cleared, but the result might still be there and the assert in lookupHost() will fail: ``` assert(!m_lookups[handle].result); ``` --- source/eventcore/drivers/posix/dns.d | 1 + 1 file changed, 1 insertion(+) diff --git a/source/eventcore/drivers/posix/dns.d b/source/eventcore/drivers/posix/dns.d index dee73b45..6449a9a8 100644 --- a/source/eventcore/drivers/posix/dns.d +++ b/source/eventcore/drivers/posix/dns.d @@ -132,6 +132,7 @@ final class EventDriverDNS_GAI(Events : EventDriverEvents, Signals : EventDriver { if (!isValid(handle)) return; m_lookups[handle].callback = null; + m_lookups[handle].result = null; m_events.loop.m_waiterCount--; }