titlebar: ref widget on get()

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-07-01 16:53:00 +02:00
parent 49f823dcb6
commit bdd6b078f2
1 changed files with 2 additions and 0 deletions

View File

@ -386,6 +386,8 @@ luaA_titlebar_widget_get(lua_State *L)
for(witer = (*tb)->widgets; witer; witer = witer->next) for(witer = (*tb)->widgets; witer; witer = witer->next)
{ {
luaA_widget_userdata_new(L, witer->widget); luaA_widget_userdata_new(L, witer->widget);
/* ref again for the list */
widget_ref(&witer->widget);
lua_setfield(L, -2, witer->widget->name); lua_setfield(L, -2, witer->widget->name);
} }