DotNetTools: Fix rare crash when opening .NET performance tab and CLR shutdown race condition
@@ -409,6 +409,8 @@ VOID AddProcessAppDomains(
Context->ProcessItem->ProcessId
);
+ if (processAppDomains)
+ {
for (ULONG i = 0; i < processAppDomains->Count; i++)
{
PhAddListViewItem(Context->AppDomainsLv, MAXINT, processAppDomains->Items[i], NULL);
@@ -417,6 +419,7 @@ VOID AddProcessAppDomains(
PhDereferenceObject(processAppDomains);
}
+ }
else
{
PPH_LIST processAppDomains = QueryDotNetAppDomainsForPid_V2(
@@ -425,6 +428,8 @@ VOID AddProcessAppDomains(
Context->ProcessItem->ProcessId
);
+ if (processAppDomains)
+ {
for (ULONG i = 0; i < processAppDomains->Count; i++)
{
PhAddListViewItem(Context->AppDomainsLv, MAXINT, processAppDomains->Items[i], NULL);
@@ -433,6 +438,7 @@ VOID AddProcessAppDomains(
PhDereferenceObject(processAppDomains);
}
+ }
SendMessage(Context->AppDomainsLv, WM_SETREDRAW, TRUE, 0);
}
