#2863305 - "Unhandled exception in comparer"

git-svn-id: svn://svn.code.sf.net/p/processhacker/code@1909 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
wj32
2009-09-22 07:49:28 +00:00
parent f0a3520f20
commit 9aa31fcc20
2 changed files with 10 additions and 0 deletions
@@ -237,6 +237,15 @@ namespace ProcessHacker
nodes.Sort(new Comparison<ProcessNode>(delegate(ProcessNode n1, ProcessNode n2)
{
// We have a problem here - the GdiHandlesNumber and UserHandlesNumber
// properties are dynamically retrieved, so if n1 == n2 we may end up
// getting different values for the same process due to the timing.
// If we do, then Array.Sort will throw an exception.
//
// The temporary HACK used here is to return 0 whenever n1 == n2.
if (n1 == n2)
return 0;
switch (sortC)
{
case "name":