Permalink
Browse files

- fixing silverlight builds... what else?

  • Loading branch information...
1 parent 65cf2dd commit b75e7c08dd022acff0d80d565a4fd7c3b54bcbee @kkozmic kkozmic committed Oct 1, 2011
View
2 src/Castle.Windsor.Tests/Registration/DynamicParametersTestCase.cs
@@ -245,7 +245,7 @@ public void Properly_releases_tracked_dendendencies_im_multithreaded_scenarios()
}
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);
View
12 src/Castle.Windsor/Facilities/TypedFactory/Internal/TypedFactoryInterceptor.cs
@@ -134,7 +134,11 @@ private void CollectDeadReferences()
}
resolveCount = 0;
+#if SL3
+ var instances = new List<object>();
+#else
var instances = new HashSet<object>(new ReferenceEqualityComparer());
+#endif
var newList = new List<WeakReference>();
foreach (var reference in resolvedTrackedComponents)
{
@@ -147,10 +151,18 @@ private void CollectDeadReferences()
{
continue;
}
+#if SL3
+ if(instances.Any(existing=> ReferenceEquals(existing,instances)) == false)
+ {
+ instances.Add(instance);
+ newList.Add(reference);
+ }
+#else
if (instances.Add(instance))
{
newList.Add(reference);
}
+#endif
}
resolvedTrackedComponents.Clear();
resolvedTrackedComponents.AddRange(newList);

0 comments on commit b75e7c0

Please sign in to comment.