X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=openbox%2Factions%2Fexit.c;h=2d9fc63312dc9c73b196474db71fb0f79bd99f83;hb=d179d6428ae585a3b8a13479bfe4586e41de2ff9;hp=f2b0cafbfafa0977ed9bb7c508c4114191218034;hpb=d45af3cb45f35ba639efac15675ed10b3515a7f0;p=chaz%2Fopenbox diff --git a/openbox/actions/exit.c b/openbox/actions/exit.c index f2b0cafb..2d9fc633 100644 --- a/openbox/actions/exit.c +++ b/openbox/actions/exit.c @@ -9,12 +9,13 @@ typedef struct { } Options; static gpointer setup_func(xmlNodePtr node); +static void free_func(gpointer o); static gboolean run_func(ObActionsData *data, gpointer options); void action_exit_startup(void) { - actions_register("Exit", setup_func, NULL, run_func); - actions_register("SessionLogout", setup_func, NULL, run_func); + actions_register("Exit", setup_func, free_func, run_func); + actions_register("SessionLogout", setup_func, free_func, run_func); } static gpointer setup_func(xmlNodePtr node) @@ -22,7 +23,7 @@ static gpointer setup_func(xmlNodePtr node) xmlNodePtr n; Options *o; - o = g_new0(Options, 1); + o = g_slice_new0(Options); o->prompt = TRUE; if ((n = obt_xml_find_node(node, "prompt"))) @@ -31,6 +32,11 @@ static gpointer setup_func(xmlNodePtr node) return o; } +static void free_func(gpointer o) +{ + g_slice_free(Options, o); +} + static void do_exit(void) { if (session_connected()) @@ -51,6 +57,7 @@ static void prompt_cleanup(ObPrompt *p, gpointer data) prompt_unref(p); } + /* Always return FALSE because its not interactive */ static gboolean run_func(ObActionsData *data, gpointer options) {