Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/05/10 05:53:30 (14 years ago)
Author:
swagner
Message:

Fixed type of caught exceptions in AsynchronousContentView (#953).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/AsynchronousContentView.cs

    r3250 r3266  
    2828      IAsyncResult result = BeginInvoke(method);
    2929      result.AsyncWaitHandle.WaitOne(1000, false);
    30       if (result.IsCompleted) EndInvoke(result);
     30      if (result.IsCompleted) try { EndInvoke(result); } catch (ObjectDisposedException) { }
    3131      else {
    3232        ThreadPool.RegisterWaitForSingleObject(result.AsyncWaitHandle,
    33           new WaitOrTimerCallback((x, b) => { try { EndInvoke(result); } catch (InvalidOperationException) { } }),
     33          new WaitOrTimerCallback((x, b) => { try { EndInvoke(result); } catch (ObjectDisposedException) { } }),
    3434          null, -1, true);
    3535      }
     
    4545      IAsyncResult result = BeginInvoke(method, args);
    4646      result.AsyncWaitHandle.WaitOne(1000, false);
    47       if (result.IsCompleted) EndInvoke(result);
     47      if (result.IsCompleted) try { EndInvoke(result); } catch (ObjectDisposedException) { }
    4848      else {
    4949        ThreadPool.RegisterWaitForSingleObject(result.AsyncWaitHandle,
    50           new WaitOrTimerCallback((x, b) => { try { EndInvoke(result); } catch (InvalidOperationException) { } }),
     50          new WaitOrTimerCallback((x, b) => { try { EndInvoke(result); } catch (ObjectDisposedException) { } }),
    5151          null, -1, true);
    5252      }
Note: See TracChangeset for help on using the changeset viewer.