[glib] allow NULL state in g_simple_action_new_stateful



commit 695a9a799355713dc6df089801b7f67a010e3b13
Author: Ryan Lortie <desrt desrt ca>
Date:   Wed Jun 29 12:28:15 2011 +0100

    allow NULL state in g_simple_action_new_stateful
    
    as an undocumented feature

 gio/gsimpleaction.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gio/gsimpleaction.c b/gio/gsimpleaction.c
index 526e02f..915a2e6 100644
--- a/gio/gsimpleaction.c
+++ b/gio/gsimpleaction.c
@@ -492,7 +492,8 @@ g_simple_action_new_stateful (const gchar        *name,
                          "parameter-type", parameter_type,
                          NULL);
 
-  simple->state = g_variant_ref_sink (state);
+  if (state)
+    simple->state = g_variant_ref_sink (state);
 
   return simple;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]