From 315aaabbce6b2db52ff5796708b777b488fd848e Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Tue, 20 May 2014 18:25:58 +1000 Subject: The results of a session with valgrind. I'm surprised that this highly experimental code, built with chewing gum and chicken wire, had so little problems, and most of those where leaks. The majority of problems reported are from external libraries. --- src/GuiLua/GuiLua.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/GuiLua/GuiLua.c') diff --git a/src/GuiLua/GuiLua.c b/src/GuiLua/GuiLua.c index 2fa9bcb..5815b45 100644 --- a/src/GuiLua/GuiLua.c +++ b/src/GuiLua/GuiLua.c @@ -204,6 +204,7 @@ static int action(lua_State *L) if (wid && strcmp(wid->magic, "Widget") == 0) { //PD("Setting action : %s\n", action); + free(wid->action); wid->action = strdup(action); } return 0; @@ -302,7 +303,7 @@ static int window(lua_State *L) } win = winFangAdd(parent, 5, 26, w, h, title, name, world); - win->module = module; + win->module = strdup(module); if (gl) { // If there's no parent, we become the parent. @@ -418,7 +419,7 @@ PD("GuiLua 3"); push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "loopWindow", "Run our windows main loop.", loopWindow, 0); push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "quit", "Quit, exit, remove thyself.", quit, 0); - push_lua(L, "@ ( = $ $ & $ )", skang, THINGASM, skang, "closeWindow", "Closes a window.", closeWindow, "userdata", 0); // TODO - closeWindow, "userdata"); + push_lua(L, "@ ( = $ $ & $ )", skang, THINGASM, skang, "closeWindow", "Closes a window.", closeWindow, "userdata", 0); // A test of the array building stuff. push_lua(L, "@ ( { = $ $ % $widget !required } )", skang, THINGASM, skang, "wibble", "It's wibbly!", 1, "'edit', 'The wibblinator:', 1, 1, 10, 50", 1, 0); -- cgit v1.1