]> granicus.if.org Git - python/commitdiff
Properly INCREF reference in Py_buffer.
authorMartin v. Löwis <martin@v.loewis.de>
Thu, 14 Aug 2008 15:56:07 +0000 (15:56 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Thu, 14 Aug 2008 15:56:07 +0000 (15:56 +0000)
Modules/_ctypes/_ctypes.c

index a6be81511aa0b7a45a26d42128bab7b9e54ed218..e53dc715d363acf7cbf828c58deee3eb8850ca40 100644 (file)
@@ -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 */