Skip to content

Commit 21a91a2

Browse files
committed
Don't release GIL in dealloc()
Fixes farcepest/MySQLdb1#84
1 parent 1153287 commit 21a91a2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

_mysql.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -2212,12 +2212,10 @@ static void
22122212
_mysql_ConnectionObject_dealloc(
22132213
_mysql_ConnectionObject *self)
22142214
{
2215-
PyObject *o;
2216-
22172215
PyObject_GC_UnTrack(self);
22182216
if (self->open) {
2219-
o = _mysql_ConnectionObject_close(self, NULL);
2220-
Py_XDECREF(o);
2217+
mysql_close(&(self->connection));
2218+
self->open = 0;
22212219
}
22222220
MyFree(self);
22232221
}

0 commit comments

Comments
 (0)