|
From: gnome-perl (bugzilla.gnome.org) <bug...@bu...> - 2009-01-13 21:26:51
|
If you have any questions why you received this email, please see the text at the end of this email. Replies to this email are NOT read, please see the text at the end of this email. You can add comments to this bug at: http://bugzilla.gnome.org/show_bug.cgi?id=567658 gnome-perl | Glib | Ver: unspecified Summary: Glib::Child->watch_add run exception handlers Product: gnome-perl Version: unspecified Platform: Other OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: Normal Component: Glib AssignedTo: gtk...@li... ReportedBy: us...@zi... QAContact: gtk...@li... GNOME version: Unspecified GNOME milestone: Unspecified The subprocess termination handler as setup by Glib::Child->watch_add could helpfully trap errors to the Glib->install_exception_handler mechanism, the same way idle, timeout and IO handlers work under a main loop. (The difference being GPerlCallback instead of the GClosure stuff.) use Glib; use strict; use warnings; my $pid = fork(); if ($pid == 0) { sleep 1; exit 0 }; Glib->install_exception_handler (sub { print "exception trapped\n"; return 1; }); Glib::Child->watch_add ($pid, sub { print "child process stopped\n"; die "now throw an error"; }); my $mainloop = Glib::MainLoop->new; $mainloop->run; -- See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received this email, why you can't respond via email, how to stop receiving emails (or reduce the number you receive), and how to contact someone if you are having problems with the system. You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=567658. |