diff --git a/keybinding.c b/keybinding.c index 9564dfe6..177637c4 100644 --- a/keybinding.c +++ b/keybinding.c @@ -127,6 +127,7 @@ luaA_keybinding_gc(lua_State *L) { keybinding_t **keybinding = luaL_checkudata(L, 1, "keybinding"); keybinding_unref(keybinding); + keybinding = NULL; return 0; } diff --git a/statusbar.c b/statusbar.c index 1df9222c..d35a8304 100644 --- a/statusbar.c +++ b/statusbar.c @@ -503,6 +503,7 @@ luaA_statusbar_gc(lua_State *L) { statusbar_t **sb = luaL_checkudata(L, 1, "statusbar"); statusbar_unref(sb); + *sb = NULL; return 0; } diff --git a/tag.c b/tag.c index cb17cb8a..2ed136bf 100644 --- a/tag.c +++ b/tag.c @@ -484,6 +484,7 @@ luaA_tag_gc(lua_State *L) { tag_t **tag = luaL_checkudata(L, 1, "tag"); tag_unref(tag); + *tag = NULL; return 0; } diff --git a/titlebar.c b/titlebar.c index 5ae5bae0..011b1288 100644 --- a/titlebar.c +++ b/titlebar.c @@ -527,6 +527,7 @@ luaA_titlebar_gc(lua_State *L) { titlebar_t **titlebar = luaL_checkudata(L, 1, "titlebar"); titlebar_unref(titlebar); + *titlebar = NULL; return 0; } diff --git a/widget.c b/widget.c index 31dcf07e..ad21f558 100644 --- a/widget.c +++ b/widget.c @@ -438,6 +438,7 @@ luaA_widget_gc(lua_State *L) { widget_t **widget = luaL_checkudata(L, 1, "widget"); widget_unref(widget); + *widget = NULL; return 0; }