From 4301642ba312f6c91d655518a3219580dfd77c73 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 28 Aug 2008 19:28:18 +0200 Subject: [PATCH] client: wipe class hint struct Signed-off-by: Julien Danjou --- client.c | 2 ++ common/xutil.h | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/client.c b/client.c index 6bd1f251..2d1991c9 100644 --- a/client.c +++ b/client.c @@ -1302,11 +1302,13 @@ luaA_client_index(lua_State *L) if(!xutil_class_hint_get(globalconf.connection, (*c)->win, &hint)) return 0; lua_pushstring(L, hint.res_class); + xutil_class_hint_wipe(&hint); break; case A_TK_INSTANCE: if(!xutil_class_hint_get(globalconf.connection, (*c)->win, &hint)) return 0; lua_pushstring(L, hint.res_name); + xutil_class_hint_wipe(&hint); break; case A_TK_ROLE: if(!xutil_text_prop_get(globalconf.connection, (*c)->win, diff --git a/common/xutil.h b/common/xutil.h index 2766148f..43021adc 100644 --- a/common/xutil.h +++ b/common/xutil.h @@ -100,6 +100,13 @@ typedef struct char *res_class; } xutil_class_hint_t; +static inline void +xutil_class_hint_wipe(xutil_class_hint_t *c) +{ + p_delete(&c->res_name); + p_delete(&c->res_class); +} + bool xutil_class_hint_get(xcb_connection_t *, xcb_window_t, xutil_class_hint_t *); bool xutil_text_prop_get(xcb_connection_t *, xcb_window_t, xcb_atom_t, char **, ssize_t *);