From beb65f011dd7428295561dc05e315066f372032a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 22 Sep 2010 00:03:17 +0200 Subject: [PATCH] tile-preview: Fix crash when falling back to default style gtk_rc_get_style_by_paths() returns NULL if no matching style was found and the default style should be used. Actually use the default style in this case. https://bugzilla.gnome.org/show_bug.cgi?id=630003 --- src/ui/tile-preview.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ui/tile-preview.c b/src/ui/tile-preview.c index a9ef07d73..1e2a71efe 100644 --- a/src/ui/tile-preview.c +++ b/src/ui/tile-preview.c @@ -111,6 +111,11 @@ on_preview_window_style_set (GtkWidget *widget, "GtkWindow.GtkIconView", GTK_TYPE_ICON_VIEW); + if (style != NULL) + g_object_ref (style); + else + style = gtk_style_new (); + gtk_style_get (style, GTK_TYPE_ICON_VIEW, "selection-box-color", &preview->preview_color, "selection-box-alpha", &preview->preview_alpha, @@ -120,6 +125,8 @@ on_preview_window_style_set (GtkWidget *widget, GdkColor selection = style->base[GTK_STATE_SELECTED]; preview->preview_color = gdk_color_copy (&selection); } + + g_object_unref (style); } MetaTilePreview *