[gnome-builder/wip/commands] commands: increment reference count before returning



commit 4422c40cf31d6b5068922255d29eab100b7d35dd
Author: Christian Hergert <christian hergert me>
Date:   Tue Oct 7 03:54:00 2014 -0700

    commands: increment reference count before returning
    
    we want to return a referenced version of the command so that we can
    dynamically generate commands in the future if we like.

 src/commands/gb-command-manager.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/commands/gb-command-manager.c b/src/commands/gb-command-manager.c
index 21ad0a0..e05d9bc 100644
--- a/src/commands/gb-command-manager.c
+++ b/src/commands/gb-command-manager.c
@@ -146,7 +146,7 @@ gb_command_manager_lookup (GbCommandManager  *manager,
   g_clear_pointer (&name, g_free);
   g_clear_pointer (&variant, g_variant_unref);
 
-  return command;
+  return command ? g_object_ref (command) : NULL;
 }
 
 static void


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