summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-12-09 16:08:09 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-12-09 16:08:09 +0000
commit9eb8b2af9117b12076ecd08a15e146ebe0790ec0 (patch)
treedebfbf3f3c5dfdda8d8ca0817afeed7a3c382a4b /gtk
parente0ee2c256fa5faa3b455dcb8b1f35900660e9e89 (diff)
downloadgdk-pixbuf-9eb8b2af9117b12076ecd08a15e146ebe0790ec0.tar.gz
Unref the buffer when freeing the RequestData. (#323577)
2005-12-09 Matthias Clasen <mclasen@redhat.com> * gtk/gtktextbuffer.c (paste_from_buffer): Unref the buffer when freeing the RequestData. (#323577)
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtktextbuffer.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c
index 3a18a739f..80859bb05 100644
--- a/gtk/gtktextbuffer.c
+++ b/gtk/gtktextbuffer.c
@@ -2934,6 +2934,13 @@ post_paste_cleanup (ClipboardRequest *request_data)
}
}
+static void
+free_clipboard_request (ClipBoardRequest *request_data)
+{
+ g_object_unref (request_data->buffer);
+ g_free (request_data);
+}
+
/* Called when we request a paste and receive the text data
*/
static void
@@ -2966,8 +2973,7 @@ clipboard_text_received (GtkClipboard *clipboard,
gtk_text_buffer_end_user_action (buffer);
}
- g_object_unref (buffer);
- g_free (request_data);
+ free_clipboard_request (request_data);
}
static GtkTextBuffer*
@@ -3069,7 +3075,8 @@ paste_from_buffer (ClipboardRequest *request_data,
gtk_text_buffer_end_user_action (buffer);
g_object_unref (src_buffer);
- g_free (request_data);
+
+ free_clipboard_request (request_data);
}
static void
@@ -3290,8 +3297,7 @@ gtk_text_buffer_paste_clipboard (GtkTextBuffer *buffer,
"gtk_paste_point_override",
override_location, FALSE);
- data->buffer = buffer;
- g_object_ref (buffer);
+ data->buffer = g_object_ref (buffer);
data->interactive = TRUE;
data->default_editable = default_editable;