--- src/menu.c.orig 2004-02-08 21:42:46.159212408 -0500 +++ src/menu.c 2004-02-08 21:51:15.072845776 -0500 @@ -321,12 +321,12 @@ return t; } - +static GtkItemFactory *ifactory = NULL; /* returns the menu widget */ static GtkWidget * create_desktop_menu (void) { - static GtkItemFactory *ifactory = NULL; + //static GtkItemFactory *ifactory = NULL; struct stat st; static char *filename = NULL; GtkWidget *img; @@ -721,6 +721,19 @@ netk_workspace_activate (ws); return TRUE; } +#include +void quithandler(int sig) { + if(ifactory) + g_object_unref(G_OBJECT(ifactory)); + + if (MainMenuData) + free_menu_data (MainMenuData); + MainMenuData = NULL; + + fprintf(stderr, "QUITTING!\n"); + + gtk_main_quit(); +} /* Initialization * -------------- @@ -733,6 +746,11 @@ DBG ("connecting callbacks"); + signal(SIGINT, quithandler); + signal(SIGTERM, quithandler); + signal(SIGQUIT, quithandler); + signal(SIGHUP, quithandler); + /* track icon theme changes (from the panel) */ if(!client) { Display *dpy = GDK_DISPLAY();