avoid potential race-condition with closing a connection
This commit is contained in:
parent
832eb2d247
commit
6e5cda6a52
@ -142,8 +142,8 @@ static void rb_mysql_client_free(void * ptr) {
|
||||
static VALUE nogvl_close(void * ptr) {
|
||||
mysql_client_wrapper *wrapper = ptr;
|
||||
if (!wrapper->closed) {
|
||||
mysql_close(wrapper->client);
|
||||
wrapper->closed = 1;
|
||||
mysql_close(wrapper->client);
|
||||
if (!wrapper->freed) {
|
||||
free(wrapper->client);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user