class Good
{
vector3 _val;
Good(const vector3& in val)
{
_val = val;
}
};
class Bad
{
vector3 _val;
Bad(const vector3& val)
{
_val = val;
}
};
void test()
{
// runs fine
for (int i = 0; i < 2; i++)
Good(vector3(1, 2, 3));
// causes vm stack corruption
for (int i = 0; i < 2; i++)
Bad(vector3(1, 2, 3));
}
This is just a simple example, the problem happens if I use any of my native POD types as well... Also, I've set EP_ALLOW_UNSAFE_REFERENCES to true to avoid using in/out for every ref. The constructor should finish the copy before the reference is invalid no?
Chris
_