[geary] Fix set_default_icon_list() ownership transfer bug



commit 67a5a9f7fc7c34dd01cc2a464a709d67b7c3145d
Author: Jim Nelson <jim yorba org>
Date:   Thu Aug 21 13:42:00 2014 -0700

    Fix set_default_icon_list() ownership transfer bug
    
    Ownership of the GList is transferred in this call, so a copy should
    be passed instead.  This will be fixed in a future version of Vala.
    
    https://mail.gnome.org/archives/vala-list/2014-August/msg00022.html

 src/client/components/main-window.vala |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/client/components/main-window.vala b/src/client/components/main-window.vala
index ebdade2..0736f80 100644
--- a/src/client/components/main-window.vala
+++ b/src/client/components/main-window.vala
@@ -61,7 +61,10 @@ public class MainWindow : Gtk.ApplicationWindow {
         
         GLib.List<Gdk.Pixbuf> pixbuf_list = new GLib.List<Gdk.Pixbuf>();
         pixbuf_list.append(IconFactory.instance.application_icon);
-        set_default_icon_list(pixbuf_list);
+        // Use copy() because set_default_icon_list() actually accepts an owned reference
+        // If we didn't hold the pixbufs in memory, would need to use copy_deep()
+        // See https://mail.gnome.org/archives/vala-list/2014-August/msg00022.html
+        set_default_icon_list(pixbuf_list.copy());
         
         delete_event.connect(on_delete_event);
         key_press_event.connect(on_key_press_event);


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