diff --git a/ext/mysql2/client.c b/ext/mysql2/client.c index fdf55cd85..ef4ecc8c0 100644 --- a/ext/mysql2/client.c +++ b/ext/mysql2/client.c @@ -144,6 +144,7 @@ static VALUE nogvl_close(void * ptr) { if (!wrapper->closed) { wrapper->closed = 1; mysql_close(wrapper->client); + wrapper->client->net.fd = -1; if (!wrapper->freed) { free(wrapper->client); }