Merge pull request #1624 from esdrubal/getprocesstimes
[mono.git] / mcs / class / System / System.Net / ServicePoint.cs
index 26a98ac353fa613f9716b483365ac0683878fe28..2a2c1cb048fa6aa63336ee442c7902bb971fa39c 100644 (file)
@@ -275,7 +275,7 @@ namespace System.Net
                        groups.Remove (group.Name);
                }
 
-               internal bool CheckAvailableForRecycling (out DateTime outIdleSince)
+               bool CheckAvailableForRecycling (out DateTime outIdleSince)
                {
                        outIdleSince = DateTime.MinValue;
 
@@ -314,7 +314,8 @@ namespace System.Net
 
                                if (removeList != null) {
                                        foreach (var group in removeList)
-                                               RemoveConnectionGroup (group);
+                                               if (groups.ContainsKey (group.Name))
+                                                       RemoveConnectionGroup (group);
                                }
 
                                if (groups != null && groups.Count == 0)