lua-users home
lua-l archive

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


I'm heaving problems with tolua when returning objects by value instead of
reference in tolua.

An example of the C/tolua class that I have, and that I want to be able
to use in lua:

class GamePos2d{
public:
GamePos2d(float x, float y);
~GamePos2d();

GamePos2d normalized();
}

When calling the normalized method in lua a new GamePos2d will be created
since it is copied by value, but it is never destroyed so a memleak will
occure.

Am I doing something wrong or is this a bug in tolua?

Note that I am using lua 4.0 and thus tolua 4.0 too.

Jardar