Commit 1a6cb19a authored by Marc Gravell's avatar Marc Gravell

Merge pull request #279 from kylestittleburg/master

Ensure Message.resultBox is nulled after successful async TryComplete
parents dcd88166 a2328ef8
...@@ -503,6 +503,12 @@ public bool TryComplete(bool isAsync) ...@@ -503,6 +503,12 @@ public bool TryComplete(bool isAsync)
if (resultBox != null) if (resultBox != null)
{ {
var ret = resultBox.TryComplete(isAsync); 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) if (performance != null)
{ {
performance.SetCompleted(); 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