lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I'm getting a memory leak from lua, tracked via the the C-Runtime libs.   I
need to access a singleton reference pointer and use it from LUA. It works
just fine, but on shutting down my application, i'm getting a 24 byte memory
leak everytime i grab an instance of my singleton. So if i access 4
different singletons in LUA, i get 4-24 byte memory leaks.  While it's not a
huge problem as we're just running the scripts at load time, it does make it
very difficult for us to clear our application of the obvious memory leaks.
I've tried switching it to a pointer mechanism but with a similar memory
leak. Everythihgn  seems to be correctly shutdown and deleted, and this is
the only leak occuring from LUA.

We're using Lua 4.0, tolua 4.0 alpha -- This is occuring under the windows
platform using static libs.

Lua Code
--
fooSingleton = foo:instance();
fooSingleton:MyFunction();


Singleton Defination
----
class foo
{
public:
	static foo& instance();
}


Thomas