From dd138de8e1bfb3730ffb7c7266760b9f7e62cde3 Mon Sep 17 00:00:00 2001 From: Brian Lopez Date: Wed, 28 Jul 2010 11:31:32 -0700 Subject: [PATCH] invalidate the file descriptor on close --- ext/mysql2/mysql2_ext.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/mysql2/mysql2_ext.c b/ext/mysql2/mysql2_ext.c index 181d6fc..3441b04 100644 --- a/ext/mysql2/mysql2_ext.c +++ b/ext/mysql2/mysql2_ext.c @@ -88,7 +88,9 @@ static void rb_mysql_client_free(void * ptr) { } static VALUE nogvl_close(void * ptr) { - mysql_close((MYSQL *)ptr); + MYSQL *client = (MYSQL *)ptr; + mysql_close(client); + client->net.fd = -1; return Qnil; }