diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2008-08-14 15:56:07 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2008-08-14 15:56:07 (GMT) |
commit | 8401eec7fab006b65b82a213f3312b96e0ae29e8 (patch) | |
tree | a8434500c94a339b884725529a8ac3d9b0b3c441 /Modules/_ctypes | |
parent | 241b8345ea913125ee5aeb04e32bfca40d9ddbce (diff) | |
download | cpython-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.c | 2 |
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 */ |