More Luabind object fun

Started by
0 comments, last by Josh Klint 12 years, 11 months ago
This code works as expected:
void Interpreter::PushObject(Object* o)
{
luabind::object lo = luabind::object(L,o);
lo.push(L);
//lo = luabind::object(L,-1);
Object* test = luabind::object_cast<Object*>(lo);
if (o != test)
{
Notify("Doesn't match!");
}
}


This code crashes with an error message:
void Interpreter::PushObject(Object* o)
{
luabind::object lo = luabind::object(L,o);
lo.push(L);
lo = luabind::object(L,-1);
Object* test = luabind::object_cast<Object*>(lo);
if (o != test)
{
Notify("Doesn't match!");
}
}


"Unhandled exception at 0x7c812afb in LE3.exe: Microsoft C++ exception: luabind::cast_failed at memory location 0x0012f724.."[/quote]

10x Faster Performance for VR: www.ultraengine.com

Advertisement
Why do I always solve my own questions right after I ask them? :D:
void Interpreter::PushObject(Object* o)
{
luabind::object lo = luabind::object(L,o);
lo.push(L);
lo = luabind::object(luabind::from_stack(L,-1));
Object* test = luabind::object_cast<Object*>(lo);
if (o != test)
{
Notify("Doesn't match!");
}
}

10x Faster Performance for VR: www.ultraengine.com

This topic is closed to new replies.

Advertisement