since we free the connection on close, there's no reason to have both flags

This commit is contained in:
Brian Lopez 2010-10-17 16:59:50 -07:00
parent 22c9ff48a8
commit 0ae583fe64
2 changed files with 1 additions and 6 deletions

View File

@ -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;
}

View File

@ -35,7 +35,6 @@ typedef struct {
VALUE encoding;
short int active;
short int closed;
short int freed;
MYSQL *client;
} mysql_client_wrapper;