[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Issues with Lunar while using multiple lunar templated objects.
- From: Sivan Thiruvengadam <rajskm@...>
- Date: Fri, 30 Oct 2009 18:26:22 -0500
Let me change this by pushing the object as you suggest and see if things work as expected.
BTW, I always hit the else part of the CLNumList constructor, since i am not passing any CLNumList instance from LUA.
I will update you as soon as i test this.
Thanks once again
2009/10/30 Ignacio Burgueño <firstname.lastname@example.org>
I think that is the problem. See, the constructor of CLNumList is assuming that at stackpos 1 there is a CLNumList.
Sivan Thiruvengadam wrote:
Yes, you are absolutely right.
CLNumList:: CLNumList(lua_State *L)
CLNL*t = static_cast< CLNL*>(lua_touserdata(L, 1));
real_object = new CNumList(*t->pT->real_object);
real_object = new CNumList();
In the case of your call to GetListofNumbers, at that position there is an instance of CLObject. I fail to see how that ends up messing the Lua side of things, but I think it is definitely wrong.
Could you just use push(L, new CLNumList) in GetListofNumbers ?
CLNumList*o = new CLNumList();
CLObject :GetListofNumbers(lua_State *L)//
// initialize it properly with the corresponding CNumList pointer