summaryrefslogtreecommitdiffstats
path: root/Modules/_ctypes
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2008-08-14 15:56:07 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2008-08-14 15:56:07 (GMT)
commit8401eec7fab006b65b82a213f3312b96e0ae29e8 (patch)
treea8434500c94a339b884725529a8ac3d9b0b3c441 /Modules/_ctypes
parent241b8345ea913125ee5aeb04e32bfca40d9ddbce (diff)
downloadcpython-8401eec7fab006b65b82a213f3312b96e0ae29e8.zip
cpython-8401eec7fab006b65b82a213f3312b96e0ae29e8.tar.gz
cpython-8401eec7fab006b65b82a213f3312b96e0ae29e8.tar.bz2
Properly INCREF reference in Py_buffer.
Diffstat (limited to 'Modules/_ctypes')
-rw-r--r--Modules/_ctypes/_ctypes.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index a6be815..e53dc71 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -2516,6 +2516,8 @@ static int CData_NewGetBuffer(PyObject *_self, Py_buffer *view, int flags)
if (view == NULL) return 0;
view->buf = self->b_ptr;
+ view->obj = _self;
+ Py_INCREF(_self);
view->len = self->b_size;
view->readonly = 0;
/* use default format character if not set */