Re: Exceptions disappear when thrown in callback
| From: | Scott Mattocks | Date: | Fri, 17 Mar 2006 14:04:32 +0000 |
| Subject: | Re: Exceptions disappear when thrown in callback | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-2641@lists.php.net to get a copy of this message | ||
Christian Weiske wrote:
No, I don't have a better idea but just killing the main loop seems kind of harsh to me. Do you really want the entire program to crash because there was an uncaught exception in a callback? What about all of the signal handlers attached to destroy? How will they be called? An application will not be able to shut down cleanly. That could lead to some serious trouble (files not closed properly, connections abruptly terminated, data loss...). If the callback passed to set_exception_handler() could be used before the loop is terminated, I think that would at least give the application the chance to shut down properly. -- Scott Mattocks http://www.crisscott.comOkay, unless someone has a better idea, I'm going to go with Christian's suggestion here. Votes?The nested main loops are a problem. E.g. GtkDialogs have the run() method that opens its own loop, so a situation with multiple loop levels can occur very often.