Explicitly dispose the event driver on thread shutdown.

Handle multiple calls to dispose() gracefully, because external code may already make an explicit call to dispose().
This commit is contained in:
Sönke Ludwig 2017-11-23 17:18:33 +01:00
parent 1cadc3077b
commit aa9a08f571
3 changed files with 9 additions and 0 deletions

View file

@ -72,7 +72,9 @@ final class WinAPIEventDriver : EventDriver {
override void dispose()
{
if (!m_events) return;
m_events.dispose();
m_events = null;
assert(threadInstance !is null);
threadInstance = null;
}