Skip to content

Commit 02abb69

Browse files
authored
fix missing reference/dereference handler (#651)
1 parent d987b48 commit 02abb69

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/RequestHandler/outofprocess/forwardinghandler.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ FORWARDING_HANDLER::OnExecuteRequestHandler()
9797
STACK_STRU(strUrl, 2048);
9898
STACK_STRU(struEscapedUrl, 2048);
9999

100+
//
101+
// Take a reference so that object does not go away as a result of
102+
// async completion.
103+
//
104+
ReferenceRequestHandler();
105+
100106
// override Protocol related config from aspNetCore config
101107
pProtocol->OverrideConfig(m_pApplication->QueryConfig());
102108

@@ -354,6 +360,12 @@ FORWARDING_HANDLER::OnExecuteRequestHandler()
354360
ReleaseSRWLockShared(&m_RequestLock);
355361
DBG_ASSERT(TlsGetValue(g_dwTlsIndex) == NULL);
356362
}
363+
364+
DereferenceRequestHandler();
365+
//
366+
// Do not use this object after dereferencing it, it may be gone.
367+
//
368+
357369
return retVal;
358370
}
359371

0 commit comments

Comments
 (0)