[gnome-builder] action: fix reference counts on variant objects.



commit bcf191eb0edd4c03e69e6abdb39bcf461c74c89b
Author: Christian Hergert <christian hergert me>
Date:   Sat Oct 11 15:48:39 2014 -0400

    action: fix reference counts on variant objects.

 src/commands/gb-command-gaction-provider.c |    3 ++-
 src/editor/gb-editor-tab.c                 |    1 -
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/commands/gb-command-gaction-provider.c b/src/commands/gb-command-gaction-provider.c
index 8952ce0..59ee5da 100644
--- a/src/commands/gb-command-gaction-provider.c
+++ b/src/commands/gb-command-gaction-provider.c
@@ -178,7 +178,8 @@ gb_command_gaction_provider_lookup (GbCommandProvider *provider,
       command = gb_command_new ();
       if (parameters)
         g_object_set_data_full (G_OBJECT (command), "parameters",
-                                parameters, (GDestroyNotify)g_variant_unref);
+                                g_variant_ref (parameters),
+                                (GDestroyNotify)g_variant_unref);
       g_object_set_data_full (G_OBJECT (command), "action",
                               g_object_ref (action), g_object_unref);
       g_signal_connect (command, "execute", G_CALLBACK (execute_action), NULL);
diff --git a/src/editor/gb-editor-tab.c b/src/editor/gb-editor-tab.c
index 8a10b76..a0cafcf 100644
--- a/src/editor/gb-editor-tab.c
+++ b/src/editor/gb-editor-tab.c
@@ -1043,7 +1043,6 @@ on_vim_command_visibility_toggled (GbEditorVim *vim,
 
   params = g_variant_new_boolean (visible);
   g_action_activate (action, params);
-  g_variant_unref (params);
 
   EXIT;
 }


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