X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=plugins%2Fmenu%2Ftimed_menu.c;h=df2acbb2464cfb45a50501694e8e901acad16699;hb=66d3006671e7729b3f6244c49fda175caaae5174;hp=788f7180e2867d55df1ced3c099c8726d6862302;hpb=78a8680cd7379cc0d75af810dabe62c7a6c4a8b2;p=chaz%2Fopenbox diff --git a/plugins/menu/timed_menu.c b/plugins/menu/timed_menu.c index 788f7180..df2acbb2 100644 --- a/plugins/menu/timed_menu.c +++ b/plugins/menu/timed_menu.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "kernel/menu.h" #include "kernel/timer.h" @@ -30,6 +31,7 @@ typedef struct { char *buf; unsigned long buflen; int fd; + pid_t pid; } Timed_Menu_Data; @@ -53,7 +55,10 @@ void timed_menu_clean_up(Menu *m) { TIMED_MENU_DATA(m)->fd = -1; } - /* child is reaped by glib ? */ + if (TIMED_MENU_DATA(m)->pid != -1) { + waitpid(TIMED_MENU_DATA(m)->pid, NULL, 0); + TIMED_MENU_DATA(m)->pid = -1; + } } void timed_menu_read_pipe(int fd, Menu *menu) @@ -133,7 +138,7 @@ void timed_menu_timeout_handler(Menu *data) NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, - NULL, + &TIMED_MENU_DATA(data)->pid, NULL, NULL, &child_stdout, @@ -167,6 +172,7 @@ void *plugin_create() d->buf = NULL; d->buflen = 0; d->fd = -1; + d->pid = -1; m->plugin_data = (void *)d;