mouse: fix button delete
We need to unref Lua functions. Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
0b5a681171
commit
4f1273794b
11
mouse.c
11
mouse.c
|
@ -70,6 +70,17 @@ a_strtocorner(const char *str, size_t len)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Delete a button.
|
||||||
|
* \param button The button to destroy.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
button_delete(button_t **button)
|
||||||
|
{
|
||||||
|
luaL_unref(globalconf.L, LUA_REGISTRYINDEX, (*button)->press);
|
||||||
|
luaL_unref(globalconf.L, LUA_REGISTRYINDEX, (*button)->release);
|
||||||
|
p_delete(button);
|
||||||
|
}
|
||||||
|
|
||||||
/** Snap an area to the outside of an area.
|
/** Snap an area to the outside of an area.
|
||||||
* \param geometry geometry of the area to snap
|
* \param geometry geometry of the area to snap
|
||||||
* \param snap_geometry geometry of snapping area
|
* \param snap_geometry geometry of snapping area
|
||||||
|
|
|
@ -115,7 +115,10 @@ struct button_t
|
||||||
/** Lua function to execute on release. */
|
/** Lua function to execute on release. */
|
||||||
luaA_ref release;
|
luaA_ref release;
|
||||||
};
|
};
|
||||||
DO_RCNT(button_t, button, p_delete)
|
|
||||||
|
void button_delete(button_t **button);
|
||||||
|
|
||||||
|
DO_RCNT(button_t, button, button_delete)
|
||||||
DO_ARRAY(button_t *, button, button_unref)
|
DO_ARRAY(button_t *, button, button_unref)
|
||||||
|
|
||||||
/** Widget */
|
/** Widget */
|
||||||
|
|
Loading…
Reference in New Issue