Skip to content

Commit

Permalink
- fixing silverlight builds... what else?
Browse files Browse the repository at this point in the history
  • Loading branch information
kkozmic committed Oct 1, 2011
1 parent 65cf2dd commit b75e7c0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Expand Up @@ -245,7 +245,7 @@ public void Properly_releases_tracked_dendendencies_im_multithreaded_scenarios()
} }
foreach (var thread in threads) foreach (var thread in threads)
{ {
Assert.True(thread.Join(TimeSpan.FromSeconds(30))); Assert.True(thread.Join((int)TimeSpan.FromSeconds(30).TotalMilliseconds));
} }


Assert.AreEqual(0, count); Assert.AreEqual(0, count);
Expand Down
Expand Up @@ -134,7 +134,11 @@ private void CollectDeadReferences()
} }


resolveCount = 0; resolveCount = 0;
#if SL3
var instances = new List<object>();
#else
var instances = new HashSet<object>(new ReferenceEqualityComparer()); var instances = new HashSet<object>(new ReferenceEqualityComparer());
#endif
var newList = new List<WeakReference>(); var newList = new List<WeakReference>();
foreach (var reference in resolvedTrackedComponents) foreach (var reference in resolvedTrackedComponents)
{ {
Expand All @@ -147,10 +151,18 @@ private void CollectDeadReferences()
{ {
continue; continue;
} }
#if SL3
if(instances.Any(existing=> ReferenceEquals(existing,instances)) == false)
{
instances.Add(instance);
newList.Add(reference);
}
#else
if (instances.Add(instance)) if (instances.Add(instance))
{ {
newList.Add(reference); newList.Add(reference);
} }
#endif
} }
resolvedTrackedComponents.Clear(); resolvedTrackedComponents.Clear();
resolvedTrackedComponents.AddRange(newList); resolvedTrackedComponents.AddRange(newList);
Expand Down

0 comments on commit b75e7c0

Please sign in to comment.