]> Pileus Git - ~andy/gtk/commitdiff
Handle pixbuf being NULL without warnings. Also, don't leak pixbuf
authorMatthias Clasen <mclasen@redhat.com>
Fri, 19 Aug 2005 18:21:31 +0000 (18:21 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 19 Aug 2005 18:21:31 +0000 (18:21 +0000)
2005-08-19  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkfilechooserbutton.c (change_icon_theme)
(model_add_special, model_add_special, model_add_volumes):
Handle pixbuf being NULL without warnings. Also, don't
leak pixbuf references when the icon theme is changed.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gtk/gtkfilechooserbutton.c

index 9d11ed4aa3bea342b367117c47b4a61babbd15d6..4742170431386f621322caf92f4fbffe67d199d5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2005-08-19  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkfilechooserbutton.c (change_icon_theme) 
+       (model_add_special, model_add_special, model_add_volumes):
+       Handle pixbuf being NULL without warnings. Also, don't
+       leak pixbuf references when the icon theme is changed.
+
        * gtk/gtkmain.c (gtk_get_event_widget): Don't access
        the user data on destroyed windows, since at best
        it can be a stale pointer.  (#313953, Robin Green)      
index 9d11ed4aa3bea342b367117c47b4a61babbd15d6..4742170431386f621322caf92f4fbffe67d199d5 100644 (file)
@@ -1,5 +1,10 @@
 2005-08-19  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkfilechooserbutton.c (change_icon_theme) 
+       (model_add_special, model_add_special, model_add_volumes):
+       Handle pixbuf being NULL without warnings. Also, don't
+       leak pixbuf references when the icon theme is changed.
+
        * gtk/gtkmain.c (gtk_get_event_widget): Don't access
        the user data on destroyed windows, since at best
        it can be a stale pointer.  (#313953, Robin Green)      
index 9d11ed4aa3bea342b367117c47b4a61babbd15d6..4742170431386f621322caf92f4fbffe67d199d5 100644 (file)
@@ -1,5 +1,10 @@
 2005-08-19  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkfilechooserbutton.c (change_icon_theme) 
+       (model_add_special, model_add_special, model_add_volumes):
+       Handle pixbuf being NULL without warnings. Also, don't
+       leak pixbuf references when the icon theme is changed.
+
        * gtk/gtkmain.c (gtk_get_event_widget): Don't access
        the user data on destroyed windows, since at best
        it can be a stale pointer.  (#313953, Robin Green)      
index c7f1e45a89c89c1fdd6fdcf11ba0bf5c77f019b1..7b41b036db56effcc8ee9ac6547ba812101aaad7 100644 (file)
@@ -1109,6 +1109,9 @@ change_icon_theme (GtkFileChooserButton *button)
       gtk_list_store_set (GTK_LIST_STORE (priv->model), &iter,
                          ICON_COLUMN, pixbuf,
                          -1);
+
+      if (pixbuf)
+       g_object_unref (pixbuf);
     }
   while (gtk_tree_model_iter_next (priv->model, &iter));
 
@@ -1311,7 +1314,8 @@ model_add_special (GtkFileChooserButton *button)
                          DATA_COLUMN, path,
                          -1);
 
-      g_object_unref (pixbuf);
+      if (pixbuf)
+       g_object_unref (pixbuf);
       button->priv->n_special++;
 
 #ifndef G_OS_WIN32
@@ -1339,7 +1343,8 @@ model_add_special (GtkFileChooserButton *button)
                          DATA_COLUMN, path,
                          -1);
 
-      g_object_unref (pixbuf);
+      if (pixbuf)
+       g_object_unref (pixbuf);
       button->priv->n_special++;
     }
 }
@@ -1379,7 +1384,8 @@ model_add_volumes (GtkFileChooserButton *button,
                          DATA_COLUMN, volumes->data,
                          -1);
 
-      g_object_unref (pixbuf);
+      if (pixbuf)
+       g_object_unref (pixbuf);
       g_free (display_name);
 
       button->priv->n_volumes++;