[recipes] Make the undo popover safe for overwriting



commit 65475efd19df38347cc2d864ec403fcfdc166ab5
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jan 9 21:55:25 2017 -0500

    Make the undo popover safe for overwriting
    
    We don't want to leak reference here when the notification gets
    overwritten before it is done.

 src/gr-window.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/gr-window.c b/src/gr-window.c
index c58c8e5..aaceb8c 100644
--- a/src/gr-window.c
+++ b/src/gr-window.c
@@ -400,7 +400,7 @@ gr_window_offer_undelete (GrWindow *window,
 {
         g_autofree char *tmp = NULL;
 
-        window->undo_recipe = g_object_ref (recipe);
+        g_set_object (&window->undo_recipe, recipe);
         tmp = g_strdup_printf (_("Recipe ā€œ%sā€ deleted"), gr_recipe_get_name (recipe));
         gtk_label_set_label (GTK_LABEL (window->undo_label), tmp);
 


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