mirror of
				https://github.com/psycopg/psycopg2.git
				synced 2025-10-30 23:37:29 +03:00 
			
		
		
		
	* psycopg/adapter_binary.c (binary_traverse): add cyclic GC
traversal for binary adapters.
This commit is contained in:
		
							parent
							
								
									47d2414e32
								
							
						
					
					
						commit
						590542e973
					
				|  | @ -1,5 +1,8 @@ | ||||||
| 2008-07-01  James Henstridge  <james@jamesh.id.au> | 2008-07-01  James Henstridge  <james@jamesh.id.au> | ||||||
| 
 | 
 | ||||||
|  | 	* psycopg/adapter_binary.c (binary_traverse): add cyclic GC | ||||||
|  | 	traversal for binary adapters. | ||||||
|  | 
 | ||||||
| 	* psycopg/adapter_asis.c (asis_traverse): add cyclic GC traversal | 	* psycopg/adapter_asis.c (asis_traverse): add cyclic GC traversal | ||||||
| 	for AsIs adapters. | 	for AsIs adapters. | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -266,6 +266,17 @@ binary_setup(binaryObject *self, PyObject *str) | ||||||
|     return 0; |     return 0; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | static int | ||||||
|  | binary_traverse(PyObject *obj, visitproc visit, void *arg) | ||||||
|  | { | ||||||
|  |     binaryObject *self = (binaryObject *)obj; | ||||||
|  | 
 | ||||||
|  |     Py_VISIT(self->wrapped); | ||||||
|  |     Py_VISIT(self->buffer); | ||||||
|  |     Py_VISIT(self->conn); | ||||||
|  |     return 0; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| static void | static void | ||||||
| binary_dealloc(PyObject* obj) | binary_dealloc(PyObject* obj) | ||||||
| { | { | ||||||
|  | @ -303,7 +314,7 @@ binary_new(PyTypeObject *type, PyObject *args, PyObject *kwds) | ||||||
| static void | static void | ||||||
| binary_del(PyObject* self) | binary_del(PyObject* self) | ||||||
| { | { | ||||||
|     PyObject_Del(self); |     PyObject_GC_Del(self); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static PyObject * | static PyObject * | ||||||
|  | @ -341,11 +352,11 @@ PyTypeObject binaryType = { | ||||||
|     0,          /*tp_setattro*/ |     0,          /*tp_setattro*/ | ||||||
|     0,          /*tp_as_buffer*/ |     0,          /*tp_as_buffer*/ | ||||||
| 
 | 
 | ||||||
|     Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/ |     Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ | ||||||
| 
 | 
 | ||||||
|     binaryType_doc, /*tp_doc*/ |     binaryType_doc, /*tp_doc*/ | ||||||
| 
 | 
 | ||||||
|     0,          /*tp_traverse*/ |     binary_traverse, /*tp_traverse*/ | ||||||
|     0,          /*tp_clear*/ |     0,          /*tp_clear*/ | ||||||
| 
 | 
 | ||||||
|     0,          /*tp_richcompare*/ |     0,          /*tp_richcompare*/ | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user