From 0ae583fe64cd481d5a54829be3f34a75342d7bcd Mon Sep 17 00:00:00 2001 From: Brian Lopez Date: Sun, 17 Oct 2010 16:59:50 -0700 Subject: [PATCH] since we free the connection on close, there's no reason to have both flags --- ext/mysql2/client.c | 6 +----- ext/mysql2/client.h | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/ext/mysql2/client.c b/ext/mysql2/client.c index f95bd53..379adff 100644 --- a/ext/mysql2/client.c +++ b/ext/mysql2/client.c @@ -133,12 +133,9 @@ static VALUE nogvl_close(void *ptr) { mysql_close(wrapper->client); wrapper->client->net.fd = -1; - } - - if (!wrapper->freed) { - wrapper->freed = 1; free(wrapper->client); } + return Qnil; } @@ -157,7 +154,6 @@ static VALUE allocate(VALUE klass) { wrapper->encoding = Qnil; wrapper->active = 0; wrapper->closed = 0; - wrapper->freed = 0; wrapper->client = (MYSQL*)malloc(sizeof(MYSQL)); return obj; } diff --git a/ext/mysql2/client.h b/ext/mysql2/client.h index fca99c4..d5c2993 100644 --- a/ext/mysql2/client.h +++ b/ext/mysql2/client.h @@ -35,7 +35,6 @@ typedef struct { VALUE encoding; short int active; short int closed; - short int freed; MYSQL *client; } mysql_client_wrapper;