diff Include/cobject.h @ 48888:27e142d99a71

#3668: When PyArg_ParseTuple correctly parses a s* format, but raises an exception afterwards (for a subsequent parameter), the user code will not call PyBuffer_Release() and memory will leak. Reviewed by Amaury Forgeot d'Arc.
author Antoine Pitrou <solipsis@pitrou.net>
date Fri, 29 Aug 2008 18:37:05 +0000
parents 86a2679dca46
children 911df82bc25d d11fbc796499
line wrap: on
line diff
--- a/Include/cobject.h	Fri Aug 29 07:13:32 2008 +0000
+++ b/Include/cobject.h	Fri Aug 29 18:37:05 2008 +0000
@@ -48,6 +48,15 @@
 /* Modify a C object. Fails (==0) if object has a destructor. */
 PyAPI_FUNC(int) PyCObject_SetVoidPtr(PyObject *self, void *cobj);
 
+
+typedef struct {
+    PyObject_HEAD
+    void *cobject;
+    void *desc;
+    void (*destructor)(void *);
+} PyCObject;
+
+
 #ifdef __cplusplus
 }
 #endif