titlebar: set to NULL after unref()

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-08-19 14:40:19 +02:00
parent a56997aefb
commit c5dfc8a40a
2 changed files with 4 additions and 0 deletions

View file

@ -708,6 +708,7 @@ client_unmanage(client_t *c)
{
simplewindow_delete(&c->titlebar->sw);
titlebar_unref(&c->titlebar);
c->titlebar = NULL;
}
ewmh_update_net_client_list(c->phys_screen);
@ -1209,6 +1210,7 @@ luaA_client_newindex(lua_State *L)
{
simplewindow_delete(&(*c)->titlebar->sw);
titlebar_unref(&(*c)->titlebar);
(*c)->titlebar = NULL;
globalconf.screens[(*c)->screen].need_arrange = true;
}

View file

@ -389,6 +389,7 @@ luaA_titlebar_newindex(lua_State *L)
{
simplewindow_delete(&(*newc)->titlebar->sw);
titlebar_unref(&(*newc)->titlebar);
(*newc)->titlebar = NULL;
globalconf.screens[(*newc)->screen].need_arrange = true;
}
/* Attach titlebar to client */
@ -404,6 +405,7 @@ luaA_titlebar_newindex(lua_State *L)
simplewindow_delete(&(*titlebar)->sw);
/* unref and NULL the ref */
titlebar_unref(&c->titlebar);
c->titlebar = NULL;
globalconf.screens[c->screen].need_arrange = true;
}
}