daily pastebin goal
52%
SHARE
TWEET

to Stephen

a guest Jul 24th, 2014 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class TestObj : IDisposable
  2. {
  3.     private TaskCompletionSource<int> tcs;
  4.  
  5.     public TestObj()
  6.     {
  7.         tcs = new TaskCompletionSource<int>();
  8.     }
  9.  
  10.     public void Dispose()
  11.     {
  12.         tcs.TrySetException(new AmbiguousMatchException());
  13.         //tcs.TrySetCanceled();
  14.     }
  15. }
  16.  
  17. public partial class MainPage
  18. {
  19.     // Constructor
  20.     public MainPage()
  21.     {
  22.         InitializeComponent();
  23.     }
  24.  
  25.     protected override void OnNavigatedTo(NavigationEventArgs e)
  26.     {
  27.         base.OnNavigatedTo(e);
  28.  
  29.         for (int i = 0; i < 100000; i++)
  30.         {
  31.             using (var obj = new TestObj())
  32.             {
  33.             }
  34.         }
  35.     }
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top