Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void Main(string[] args)
- {
- {
- HandlingObject subscriber = new HandlingObject();
- {
- {
- EventedObject publisher = new EventedObject();
- publisher.DoIt += subscriber.Yeah;
- }
- GC.Collect(GC.MaxGeneration);
- GC.WaitForPendingFinalizers();
- Thread.MemoryBarrier();
- Trace.Assert(Log == EventedObjectDisposed);
- }
- //Assertion needed for foo reference, else optimization causes it to already be collected.
- Trace.Assert(subscriber != null);
- }
- GC.Collect(GC.MaxGeneration);
- GC.WaitForPendingFinalizers();
- Thread.MemoryBarrier();
- Trace.Assert(Log == HandlingObjectDisposed);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement