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;