Commit a2328ef8 authored by Kyle Stittleburg's avatar Kyle Stittleburg

Ensure Message.resultBox is nulled after successful async TryComplete

Since ResultBox.TryComplete will unwrap and recycle in the async use
case, we can no longer trust the resultBox reference and will want to
null it out.
parent c94917a1
......@@ -501,6 +501,12 @@ public bool TryComplete(bool isAsync)
if (resultBox != null)
{
var ret = resultBox.TryComplete(isAsync);
if (ret && isAsync)
{
resultBox = null; // in async mode TryComplete will have unwrapped and recycled resultBox; ensure we no longer reference it via this message
}
if (performance != null)
{
performance.SetCompleted();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment