mirror of
https://github.com/tmux/tmux.git
synced 2024-12-13 18:38:48 +00:00
Change deref to the more sensible unref, and add a couple I missed before.
This commit is contained in:
parent
8c93b768e4
commit
10e90ae01f
2
cfg.c
2
cfg.c
@ -108,7 +108,7 @@ cfg_default_done(unused struct cmd_q *cmdq)
|
|||||||
*/
|
*/
|
||||||
if (!TAILQ_EMPTY(&cfg_client->cmdq->queue))
|
if (!TAILQ_EMPTY(&cfg_client->cmdq->queue))
|
||||||
cmdq_continue(cfg_client->cmdq);
|
cmdq_continue(cfg_client->cmdq);
|
||||||
cfg_client->references--;
|
server_client_unref(cfg_client);
|
||||||
cfg_client = NULL;
|
cfg_client = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ cmd_confirm_before_free(void *data)
|
|||||||
struct cmd_confirm_before_data *cdata = data;
|
struct cmd_confirm_before_data *cdata = data;
|
||||||
struct client *c = cdata->client;
|
struct client *c = cdata->client;
|
||||||
|
|
||||||
server_client_deref(c);
|
server_client_unref(c);
|
||||||
|
|
||||||
free(cdata->cmd);
|
free(cdata->cmd);
|
||||||
free(cdata);
|
free(cdata);
|
||||||
|
@ -132,7 +132,7 @@ cmd_load_buffer_callback(struct client *c, int closed, void *data)
|
|||||||
return;
|
return;
|
||||||
c->stdin_callback = NULL;
|
c->stdin_callback = NULL;
|
||||||
|
|
||||||
server_client_deref(c);
|
server_client_unref(c);
|
||||||
if (c->flags & CLIENT_DEAD)
|
if (c->flags & CLIENT_DEAD)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
2
notify.c
2
notify.c
@ -121,7 +121,7 @@ notify_drain(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ne->client != NULL)
|
if (ne->client != NULL)
|
||||||
ne->client->references--;
|
server_client_unref(ne->client);
|
||||||
if (ne->session != NULL)
|
if (ne->session != NULL)
|
||||||
ne->session->references--;
|
ne->session->references--;
|
||||||
if (ne->window != NULL)
|
if (ne->window != NULL)
|
||||||
|
@ -222,7 +222,7 @@ server_client_lost(struct client *c)
|
|||||||
if (event_initialized(&c->event))
|
if (event_initialized(&c->event))
|
||||||
event_del(&c->event);
|
event_del(&c->event);
|
||||||
|
|
||||||
server_client_deref(c);
|
server_client_unref(c);
|
||||||
|
|
||||||
server_add_accept(0); /* may be more file descriptors now */
|
server_add_accept(0); /* may be more file descriptors now */
|
||||||
|
|
||||||
@ -233,9 +233,9 @@ server_client_lost(struct client *c)
|
|||||||
|
|
||||||
/* Remove reference from a client. */
|
/* Remove reference from a client. */
|
||||||
void
|
void
|
||||||
server_client_deref(struct client *c)
|
server_client_unref(struct client *c)
|
||||||
{
|
{
|
||||||
log_debug("deref client %d (%d references)", c->ibuf.fd, c->references);
|
log_debug("unref client %d (%d references)", c->ibuf.fd, c->references);
|
||||||
|
|
||||||
c->references--;
|
c->references--;
|
||||||
if (c->references == 0)
|
if (c->references == 0)
|
||||||
|
2
tmux.h
2
tmux.h
@ -1871,7 +1871,7 @@ int server_client_check_nested(struct client *);
|
|||||||
void server_client_handle_key(struct client *, int);
|
void server_client_handle_key(struct client *, int);
|
||||||
void server_client_create(int);
|
void server_client_create(int);
|
||||||
int server_client_open(struct client *, char **);
|
int server_client_open(struct client *, char **);
|
||||||
void server_client_deref(struct client *);
|
void server_client_unref(struct client *);
|
||||||
void server_client_lost(struct client *);
|
void server_client_lost(struct client *);
|
||||||
void server_client_callback(int, short, void *);
|
void server_client_callback(int, short, void *);
|
||||||
void server_client_status_timer(void);
|
void server_client_status_timer(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user