From: Steven Luo Date: Sat, 6 Feb 2010 10:00:38 +0000 (-0800) Subject: Kill MicroB browser UI processes instead of using exit_browser X-Git-Tag: v3.2~25 X-Git-Url: http://git.maemo.org/git/?p=browser-switch;a=commitdiff_plain;h=88db94294d5f27f30d2fa30f9cb90c122f36b176 Kill MicroB browser UI processes instead of using exit_browser Reports from users suggest that the exit_browser method call currently being used to close the MicroB browser UI processes may not be working reliably. Try a kill() instead, and hope that this doesn't introduce data loss problems ... --- diff --git a/launcher.c b/launcher.c index 02bc3eb..6a70c82 100644 --- a/launcher.c +++ b/launcher.c @@ -32,6 +32,7 @@ #ifdef FREMANTLE #include +#include #endif #include "browser-switchboard.h" @@ -307,6 +308,7 @@ void launch_microb(struct swb_context *ctx, char *uri) { exit(1); } } + g_object_unref(g_proxy); /* Workaround: the browser process we started is going to want to hang around forever, hogging the com.nokia.osso_browser @@ -370,20 +372,10 @@ void launch_microb(struct swb_context *ctx, char *uri) { dbus_connection_close(raw_connection); dbus_connection_unref(raw_connection); - /* Tell browser UI to exit nicely */ - printf("Closing MicroB\n"); - if (!dbus_g_proxy_call(g_proxy, "exit_browser", &gerror, - G_TYPE_INVALID, G_TYPE_INVALID)) { - /* We don't expect a reply; any other error indicates - a problem */ - if (gerror->domain != DBUS_GERROR || - gerror->code != DBUS_GERROR_NO_REPLY) { - printf("exit_browser failed: %s\n", - gerror->message); - exit(1); - } - } - g_object_unref(g_proxy); + /* Kill off browser UI + XXX: Hope we don't cause data loss here! */ + printf("Killing MicroB\n"); + kill(pid, SIGTERM); } else { /* Child process */ close_stdio();