pygobject r956 - in trunk: . glib gobject



Author: gjc
Date: Sat Aug 30 19:04:42 2008
New Revision: 956
URL: http://svn.gnome.org/viewvc/pygobject?rev=956&view=rev

Log:
	* glib/pyglib.h: * gobject/pygobject.c: Fix memory problems
	reported by valgrind due to invalid tp_basicsize in
	PyGPropsDescr_Type.  Closes #549945.



Modified:
   trunk/ChangeLog
   trunk/glib/pyglib.h
   trunk/gobject/pygobject.c

Modified: trunk/glib/pyglib.h
==============================================================================
--- trunk/glib/pyglib.h	(original)
+++ trunk/glib/pyglib.h	Sat Aug 30 19:04:42 2008
@@ -76,7 +76,8 @@
     PyObject_HEAD_INIT(NULL)                            \
     0,                                                  \
     typename,						\
-    sizeof(csymbol)                                     \
+    sizeof(csymbol),                                    \
+    0,                                                  \
 };
 #define PYGLIB_REGISTER_TYPE(d, type, name)	        \
     if (!type.tp_alloc)                                 \

Modified: trunk/gobject/pygobject.c
==============================================================================
--- trunk/gobject/pygobject.c	(original)
+++ trunk/gobject/pygobject.c	Sat Aug 30 19:04:42 2008
@@ -419,7 +419,8 @@
     0
 };
 
-PYGLIB_DEFINE_TYPE("gobject.GPropsDescr", PyGPropsDescr_Type, 0);
+struct empty {} _empty;
+PYGLIB_DEFINE_TYPE("gobject.GPropsDescr", PyGPropsDescr_Type, _empty);
 
 static PyObject *
 pyg_props_descr_descr_get(PyObject *self, PyObject *obj, PyObject *type)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]