Grrrrr......
Ok, I have a thread [t2] which is happily running around. This uses some objects supplied by a third party (in this case microsoft).
Now as the app is terminated the thread [t2] gets terminated, but the objects it is using are on yet another thread [t3]. This get killed first.
Now, the first part of the problem is that the objects dspose themselves and throw "disposed" exceptions. Thus [t2] gets an exception what it tries to access their parent object [on which there is no indication of disposed].
So, I can esily enough code an exception handler to swallow disposed exceptions - but that is a bit too agressive. What I want to do is detect that the application is shutting down. I can't seem to find a way of detecting this :-(. [except maybe by producing an exception handler for threads and checking IsTerminaring]
n.b. System.Environment.HasShutdownStarted is false at this point
[I can't simply set a property somewhere myself, the application does not have a structured exit, any exit is only caused by an abort of some description]
Ok, I have a thread [t2] which is happily running around. This uses some objects supplied by a third party (in this case microsoft).
Now as the app is terminated the thread [t2] gets terminated, but the objects it is using are on yet another thread [t3]. This get killed first.
Now, the first part of the problem is that the objects dspose themselves and throw "disposed" exceptions. Thus [t2] gets an exception what it tries to access their parent object [on which there is no indication of disposed].
So, I can esily enough code an exception handler to swallow disposed exceptions - but that is a bit too agressive. What I want to do is detect that the application is shutting down. I can't seem to find a way of detecting this :-(. [except maybe by producing an exception handler for threads and checking IsTerminaring]
n.b. System.Environment.HasShutdownStarted is false at this point

[I can't simply set a property somewhere myself, the application does not have a structured exit, any exit is only caused by an abort of some description]

Comment