[Mono-dev] issue with testing dispose code
basjsmit at gmail.com
Sun Mar 1 07:59:40 EST 2009
Im looking at Mono Ninject2 compatibility and Ive come across a problem.
Nate has a bunch of tests to check his dispose code (example below). For
this purpose we need a way to force disposing of unused objects. Currently
the tests use GC.Collect() for that, however on mono that doesnt necessarily
mean that unused objects are disposed of. Is there a way to force the GC to
dispose of all unused objects?
Here is an example of such a (xunit) test:
var cache = kernel.Components.Get<ICache>();
NotifiesWhenDisposed instance = null;
ThreadStart callback = () => instance =
var thread = new Thread(callback);
thread = null;
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list