Using the updated gridtable.wx.wlua example and the latest source from the repository from the examples folder and adding a timer to call ForceRefresh() on the wxGrid every 30ms still causes memory to be leaked. The number reported by collectgarbage"count" will however now remain the same for a long time, but then will double, and this will repeat taking long each time to double. Memory usage from within windows xp goes up slowly, I experienced it appearing to stop at 27,080 K with 13,968.4 being reported from collectgarbage"count", however waiting longer it all of a sudden starting going up again and the number reported by collectgarvage"count" doubled virtually instanly to 27,027.4, with the mem usage in windows task manager continuing to climb. I am attaching the gridtable.wx.wlua example that has only been modified to add the periodic call to ForceRefresh, and every 1000 times ForceRefresh() is called, pop up a message displaying the collectgarbage"count".
wxGridTable example calling grid:ForceRefresh()
I think the memory leak is slower though after the previous svn commits. I recompiled from the latest svn revision using Visual C++ 2005 Express Edition using wxWidgets 2.8.12. I will try again with the previous version of wxLua to compare how fast memory is leaking now to how fast it was leaking before.
Continuing to let the example run it is now using 59,088 K in windows task manager and 53136.4 is being reported from collectgarbage"count"
It should be fixed in SVN now. The Lua functions that the virtual wxLuaGridTableBase functions call were not popped as they should have so the stack was growing. I do not see any increase in memory after running for quite some time now.
You can reopen this ticket if you still find a problem.
ps. Just in case you were wondering, you need to call wxTimer::Stop() in a wxEVT_DESTROY handler for the wxFrame to allow the wxEvtLoop and therefore the program to ever exit.