mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-15 21:59:41 -04:00
MINOR: hlua: Add function to release a lua function
release_hlua_function() must be used to release a lua function. Some fixes depends on this function.
This commit is contained in:
parent
147b8c919c
commit
dda44442d5
1 changed files with 10 additions and 0 deletions
10
src/hlua.c
10
src/hlua.c
|
|
@ -318,6 +318,16 @@ static inline struct hlua_function *new_hlua_function()
|
|||
return fcn;
|
||||
}
|
||||
|
||||
static inline void release_hlua_function(struct hlua_function *fcn)
|
||||
{
|
||||
if (!fcn)
|
||||
return;
|
||||
if (fcn->name)
|
||||
ha_free(&fcn->name);
|
||||
LIST_DEL(&fcn->l);
|
||||
ha_free(&fcn);
|
||||
}
|
||||
|
||||
/* If the common state is set, the stack id is 0, otherwise it is the tid + 1 */
|
||||
static inline int fcn_ref_to_stack_id(struct hlua_function *fcn)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue