Fix segfault when checking detached graph completion status

Signed-off-by: Jeremy Ong <jcong@amazon.com>
This commit is contained in:
Jeremy Ong
2021-08-05 17:32:57 -06:00
parent eaa6e087cf
commit 4743ca8bc1
@@ -258,7 +258,8 @@ namespace AZ
}
}
if (task->m_graph->Release() == (task->m_graph->m_parent ? 1 : 0))
bool isRetained = task->m_graph->m_parent != nullptr;
if (task->m_graph->Release() == (isRetained ? 1 : 0))
{
m_executor->ReleaseGraph();
}