pygtk r3081 - in trunk: . gtk
- From: gjc svn gnome org
- To: svn-commits-list gnome org
- Subject: pygtk r3081 - in trunk: . gtk
- Date: Sun, 1 Feb 2009 18:08:56 +0000 (UTC)
Author: gjc
Date: Sun Feb 1 18:08:56 2009
New Revision: 3081
URL: http://svn.gnome.org/viewvc/pygtk?rev=3081&view=rev
Log:
Bug 567747 â ugly trace when copy/pasting in a custom gtk.TextView
Modified:
trunk/ChangeLog
trunk/gtk/gtktextview.override
Modified: trunk/gtk/gtktextview.override
==============================================================================
--- trunk/gtk/gtktextview.override (original)
+++ trunk/gtk/gtktextview.override Sun Feb 1 18:08:56 2009
@@ -1379,6 +1379,7 @@
guint8 *ret;
PyGObject *content_buffer;
GtkTextIter *start = NULL, *end = NULL;
+ PyObject *py_retval;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"O!OOO:GtkTextBuffer.serialize",
@@ -1407,7 +1408,9 @@
ret = gtk_text_buffer_serialize(GTK_TEXT_BUFFER(self->obj),
GTK_TEXT_BUFFER(content_buffer->obj),
format, start, end, &length);
- return PyString_FromStringAndSize((char *) ret, (Py_ssize_t) length);
+ py_retval = PyString_FromStringAndSize((char *) ret, (Py_ssize_t) length);
+ g_free(ret);
+ return py_retval;
}
%%
override gtk_text_buffer_register_deserialize_format kwargs
@@ -1529,6 +1532,7 @@
if (retobj != NULL) {
PyString_AsStringAndSize(retobj, (gchar**)&ret, (Py_ssize_t*) length);
+ ret = g_memdup(ret, *length);
Py_DECREF(retobj);
} else {
PyErr_Print();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]