mirror of
https://github.com/tmux/tmux.git
synced 2025-01-05 23:38:48 +00:00
Grouped sessions were being leaked on destroy, correctly free them.
This commit is contained in:
parent
965edf8a5c
commit
b0b5cad496
@ -398,14 +398,15 @@ void
|
|||||||
server_destroy_session_group(struct session *s)
|
server_destroy_session_group(struct session *s)
|
||||||
{
|
{
|
||||||
struct session_group *sg;
|
struct session_group *sg;
|
||||||
|
struct session *s1;
|
||||||
|
|
||||||
if ((sg = session_group_find(s)) == NULL)
|
if ((sg = session_group_find(s)) == NULL)
|
||||||
server_destroy_session(s);
|
server_destroy_session(s);
|
||||||
else {
|
else {
|
||||||
TAILQ_FOREACH(s, &sg->sessions, gentry)
|
TAILQ_FOREACH_SAFE(s, &sg->sessions, gentry, s1) {
|
||||||
server_destroy_session(s);
|
server_destroy_session(s);
|
||||||
TAILQ_REMOVE(&session_groups, sg, entry);
|
session_destroy(s);
|
||||||
free(sg);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,6 +150,7 @@ void
|
|||||||
session_destroy(struct session *s)
|
session_destroy(struct session *s)
|
||||||
{
|
{
|
||||||
struct winlink *wl;
|
struct winlink *wl;
|
||||||
|
|
||||||
log_debug("session %s destroyed", s->name);
|
log_debug("session %s destroyed", s->name);
|
||||||
|
|
||||||
RB_REMOVE(sessions, &sessions, s);
|
RB_REMOVE(sessions, &sessions, s);
|
||||||
|
Loading…
Reference in New Issue
Block a user