[geary/geary-0.6] Fix set_default_icon_list() ownership transfer bug



commit 0c80395591c1dd8255357db71a7a0e22cc3198b6
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 31fdc14..534cc39 100644
--- a/src/client/components/main-window.vala
+++ b/src/client/components/main-window.vala
@@ -60,7 +60,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]