From 225aee7072ca9c565a40949b9a243111ddb65edc Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 20 Jun 2006 20:40:34 -0400 Subject: [PATCH] Fixed memory leak on destroying clients --- cmd/wm/client.c | 2 ++ cmd/wm/view.c | 2 +- cmd/wm/wm.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/wm/client.c b/cmd/wm/client.c index d647db44..7dbed9be 100644 --- a/cmd/wm/client.c +++ b/cmd/wm/client.c @@ -382,6 +382,8 @@ destroy_client(Client *c) for(v=view; v; v=v->next) detach_from_view(v, c); + *c->tags = '\0'; + update_client_views(c); unmap_client(c); diff --git a/cmd/wm/view.c b/cmd/wm/view.c index 2c51a2b8..e62c4868 100644 --- a/cmd/wm/view.c +++ b/cmd/wm/view.c @@ -300,7 +300,7 @@ arrange_view(View *v) } } -static void +void update_client_views(Client *c) { static ViewLink *free_view_links = nil; diff --git a/cmd/wm/wm.h b/cmd/wm/wm.h index bea68c04..0db2ebb5 100644 --- a/cmd/wm/wm.h +++ b/cmd/wm/wm.h @@ -326,6 +326,7 @@ void arrange_view(View *v); void scale_view(View *v, float w); View *create_view(const char *name); void focus_view(View *v); +void update_client_views(Client *c); XRectangle *rects_of_view(View *v, unsigned int *num); View *view_of_id(unsigned short id); void select_view(const char *arg);