Add central Lua shutdown function and use it

- makes sure lua garbage collect runs
- memory used by lua gets freed
This commit is contained in:
Panu Matilainen 2009-01-14 15:18:25 +02:00
parent 6be1bdf125
commit 267e77f1c1
3 changed files with 12 additions and 0 deletions

View File

@ -35,4 +35,10 @@ void rpmLuaInit(void)
return;
}
void rpmLuaFree(void)
{
rpmlua lua = rpmluaGetGlobalState();
rpmluaFree(lua);
}
#endif /* WITH_LUA */

View File

@ -4,4 +4,7 @@
/* Initialize Lua subsystem & register all our extensions */
void rpmLuaInit(void);
/* Shutdown Lua subsystem */
void rpmLuaFree(void);
#endif /* _RPMLIBLUA_H */

View File

@ -1606,6 +1606,9 @@ void rpmFreeRpmrc(void)
/* XXX doesn't really belong here but... */
rpmFreeCrypto();
#ifdef WITH_LUA
rpmLuaFree();
#endif
return;
}