[gtk+] Don't g_object_unref cairo surfaces
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Don't g_object_unref cairo surfaces
- Date: Thu, 3 Feb 2011 03:06:02 +0000 (UTC)
commit 7894ff4bcbdb4c19c4f52d1d5e043377355e0e52
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Feb 2 22:05:26 2011 -0500
Don't g_object_unref cairo surfaces
This was causing warnings when dragging text from labels.
gtk/gtklabel.c | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 12b0d6a..a99f7a1 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -4883,22 +4883,24 @@ drag_begin_cb (GtkWidget *widget,
if (end > len)
end = len;
-
+
if (start > len)
start = len;
-
- surface = _gtk_text_util_create_drag_icon (widget,
- priv->text + start,
- end - start);
+
+ surface = _gtk_text_util_create_drag_icon (widget,
+ priv->text + start,
+ end - start);
}
if (surface)
- gtk_drag_set_icon_surface (context, surface);
+ {
+ gtk_drag_set_icon_surface (context, surface);
+ cairo_surface_destroy (surface);
+ }
else
- gtk_drag_set_icon_default (context);
-
- if (surface)
- g_object_unref (surface);
+ {
+ gtk_drag_set_icon_default (context);
+ }
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]