Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TestObj : IDisposable
- {
- private TaskCompletionSource<int> tcs;
- public TestObj()
- {
- tcs = new TaskCompletionSource<int>();
- }
- public void Dispose()
- {
- tcs.TrySetException(new AmbiguousMatchException());
- //tcs.TrySetCanceled();
- }
- }
- public partial class MainPage
- {
- // Constructor
- public MainPage()
- {
- InitializeComponent();
- }
- protected override void OnNavigatedTo(NavigationEventArgs e)
- {
- base.OnNavigatedTo(e);
- for (int i = 0; i < 100000; i++)
- {
- using (var obj = new TestObj())
- {
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement