client: wipe class hint struct

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-08-28 19:28:18 +02:00
parent 0c0232e072
commit 4301642ba3
2 changed files with 9 additions and 0 deletions

View File

@ -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,

View File

@ -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 *);