mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-03-03 23:55:46 +03:00
Fixed attempt of closing an already closed lobject on dealloc
This results in a "null without exception set" in the corrent state, which is caused by the connection being unexpectedly closed anyway.
This commit is contained in:
parent
2e55b35d5d
commit
3752880b7b
|
@ -355,7 +355,7 @@ lobject_dealloc(PyObject* obj)
|
||||||
{
|
{
|
||||||
lobjectObject *self = (lobjectObject *)obj;
|
lobjectObject *self = (lobjectObject *)obj;
|
||||||
|
|
||||||
if (self->conn) { /* if not, init failed */
|
if (self->conn && self->fd != -1) {
|
||||||
if (lobject_close(self) < 0)
|
if (lobject_close(self) < 0)
|
||||||
PyErr_Print();
|
PyErr_Print();
|
||||||
Py_XDECREF((PyObject*)self->conn);
|
Py_XDECREF((PyObject*)self->conn);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user