summaryrefslogtreecommitdiff
path: root/gnome-settings-daemon
diff options
context:
space:
mode:
authorWilliam Jon McCann <jmccann@redhat.com>2010-01-09 13:32:58 -0500
committerWilliam Jon McCann <jmccann@redhat.com>2010-01-09 13:33:23 -0500
commita563f0f430367f5b790dbb83490584e939a73e02 (patch)
tree2b7092ffe028f8c567c4fa1d41becae58d687964 /gnome-settings-daemon
parent817c1017b88963d717ff1ad014bca0733284eb87 (diff)
downloadgnome-settings-daemon-a563f0f430367f5b790dbb83490584e939a73e02.tar.gz
Add timed exit option
Useful for checking for leaks with valgrind.
Diffstat (limited to 'gnome-settings-daemon')
-rw-r--r--gnome-settings-daemon/main.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gnome-settings-daemon/main.c b/gnome-settings-daemon/main.c
index d27d5431..05d081ba 100644
--- a/gnome-settings-daemon/main.c
+++ b/gnome-settings-daemon/main.c
@@ -47,6 +47,7 @@
static char *gconf_prefix = NULL;
static gboolean no_daemon = FALSE;
static gboolean debug = FALSE;
+static gboolean do_timed_exit = FALSE;
static int daemon_pipe_fds[2];
static int term_signal_pipe_fds[2];
@@ -54,9 +55,17 @@ static GOptionEntry entries[] = {
{"debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
{"no-daemon", 0, 0, G_OPTION_ARG_NONE, &no_daemon, N_("Don't become a daemon"), NULL },
{"gconf-prefix", 0, 0, G_OPTION_ARG_STRING, &gconf_prefix, N_("GConf prefix from which to load plugin settings"), NULL},
+ { "timed-exit", 0, 0, G_OPTION_ARG_NONE, &do_timed_exit, N_("Exit after a time - for debugging"), NULL },
{NULL}
};
+static gboolean
+timed_exit_cb (void)
+{
+ gtk_main_quit ();
+ return FALSE;
+}
+
static DBusGProxy *
get_bus_proxy (DBusGConnection *connection)
{
@@ -486,6 +495,10 @@ main (int argc, char *argv[])
daemon_terminate_parent ();
+ if (do_timed_exit) {
+ g_timeout_add (1000 * 30, (GSourceFunc) timed_exit_cb, NULL);
+ }
+
gtk_main ();
out: