]> Dogcows Code - chaz/openbox/blobdiff - openbox/actions/focus.c
more using g_slice_new() instead of g_new()
[chaz/openbox] / openbox / actions / focus.c
index 8bae49c7a1aaf0778aa142d789f4a43b0366682f..6c8957c81eca6370814f35a86abe42834b280d1e 100644 (file)
@@ -10,11 +10,12 @@ 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_focus_startup(void)
 {
-    actions_register("Focus", setup_func, g_free, run_func);
+    actions_register("Focus", 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->stop_int = TRUE;
 
     if ((n = obt_xml_find_node(node, "here")))
@@ -32,6 +33,11 @@ static gpointer setup_func(xmlNodePtr node)
     return o;
 }
 
+static void free_func(gpointer o)
+{
+    g_slice_free(Options, o);
+}
+
 /* Always return FALSE because its not interactive */
 static gboolean run_func(ObActionsData *data, gpointer options)
 {
This page took 0.018328 seconds and 4 git commands to generate.