Lock when removing disconnect handler (#6862)

This commit is contained in:
Pavel Krymets 2019-01-18 20:25:56 -08:00 committed by GitHub
parent b9e0889228
commit f83f3bca08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -53,5 +53,6 @@ void DisconnectHandler::SetHandler(std::unique_ptr<IREQUEST_HANDLER, IREQUEST_HA
void DisconnectHandler::RemoveHandler() noexcept
{
SRWExclusiveLock lock(m_handlerLock);
m_pHandler = nullptr;
}

View File

@ -24,6 +24,8 @@ public:
VOID
ReferenceRequestHandler() noexcept override
{
DBG_ASSERT(m_cRefs != 0);
InterlockedIncrement(&m_cRefs);
}