1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-09-30 05:59:07 +00:00

* Fix leaks

* Fix HUP behaviour - scripts are now reloaded on HUP
* Remove unneccessary calls to llua_close()
This commit is contained in:
Toni Spets 2009-05-15 23:35:18 +03:00
parent b5934e5f69
commit 66ba6e36c9
2 changed files with 11 additions and 3 deletions

View File

@ -854,10 +854,10 @@ static void free_text_objects(struct text_object *root)
#endif
#ifdef HAVE_LUA
case OBJ_lua:
llua_close();
free(data.s);
break;
case OBJ_lua_bar:
llua_close();
free(data.s);
break;
#endif
case OBJ_pre_exec:
@ -4192,7 +4192,7 @@ static void generate_text_internal(char *p, int p_max_size,
#ifdef X11
OBJ(lua_bar) {
int per;
if(llua_getpercent(strdup(obj->data.s), &per)) {
if(llua_getpercent(obj->data.s, &per)) {
new_bar(p, obj->a, obj->b, (per/100.0 * 255));
}
}
@ -6646,6 +6646,10 @@ static void reload_config(void)
tcp_portmon_clear();
#endif
#ifdef HAVE_LUA
llua_close();
#endif
if (current_config) {
clear_fs_stats();
load_config_file(current_config);
@ -6747,6 +6751,9 @@ static void clean_up(void)
#ifdef RSS
free_rss_info();
#endif
#ifdef HAVE_LUA
llua_close();
#endif
if (specials) {
unsigned int i;

View File

@ -40,6 +40,7 @@ void llua_init()
void llua_load(const char *script)
{
int error;
if(!lua_L) return;
error = luaL_loadfile(lua_L, script);
if(error) {
ERR("llua_load: %s", lua_tostring(lua_L, -1));