[Gtk-sharp-list] Creating critical section for unhandled exception handler

Styne jason.steenstrapickens at orionhealth.com
Mon May 24 16:18:21 EDT 2010

Christopher David Howie wrote:
> What member of what class are you attaching your event handler to?

I am adding it to ExceptionManager.UnhandledException like it says on 

Christopher David Howie wrote:
> Run() blocks in that it does not return until the dialog is closed.  But
> it must call the GLib main loop again, because this loop is responsible
> for dispatching GTK+ events.  In other words, if it did not re-enter the
> main loop, the dialog would not be able to respond to events.  So this
> is the possible execution path I see:
> * GLib main loop.
> ** Unhandled exception handler, calls Dialog.Run().
> *** Dialog.Run() sets up the dialog, calls main loop to process events.
> **** GLib main loop.
> ***** Unhandled exception handler.
> ****** ...

Ah ok that makes more sense. I take it that has something to do with why the
dialogs aren't drawn properly until I force a UI event to occur.

Christopher David Howie wrote:
> It sounds like you need a more sophisticated mechanism to handle the
> case where exceptions may be thrown while the dialog is shown.  You
> might consider using a Queue<> to hold exceptions that have been thrown.
>  Additionally, you should be very careful to catch every possible
> exception that might occur in your UnhandledException handler so as to
> prevent an infinite loop.

Yes I will have to rethink this a bit more and decide exactly what behavior
I want.

Well that pretty much answers my question now. Thanks!
View this message in context: http://mono.1490590.n4.nabble.com/Creating-critical-section-for-unhandled-exception-handler-tp2225522p2229128.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.

More information about the Gtk-sharp-list mailing list