Browse Source

Hold an extra reference for the redirect_client message in the redirector

master
Con Kolivas 10 years ago
parent
commit
3ba8e1d6c1
  1. 8
      src/connector.c

8
src/connector.c

@ -134,6 +134,13 @@ static void __inc_instance_ref(client_instance_t *client)
client->ref++;
}
static void inc_instance_ref(cdata_t *cdata, client_instance_t *client)
{
ck_wlock(&cdata->lock);
__inc_instance_ref(client);
ck_wunlock(&cdata->lock);
}
/* Increase the reference count of instance */
static void __dec_instance_ref(client_instance_t *client)
{
@ -713,6 +720,7 @@ static void redirect_client(ckpool_t *ckp, client_instance_t *client)
sender_send->client = client;
sender_send->buf = buf;
sender_send->len = strlen(buf);
inc_instance_ref(cdata, client);
mutex_lock(&cdata->sender_lock);
cdata->sends_generated++;

Loading…
Cancel
Save