You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For chugins, the API->object->create() method does not invoke the constructor of the type it creates.
E.g.
// Foo object that holds arbitrary datastructFoo { charbuff[256]; }
// default ck constructor of the object we're creating in a functionCK_DLL_CTOR(foo_ctor)
{
// allocates memory to hold struct dataOBJ_MEMBER_UINT(SELF, foo_data_ptr_offset) = (t_CKUINT) newFoo;
}
// function that creates and returns a FooCK_DLL_SFUN(create_foo)
{
Chuck_Object*foo_obj=API->object->create(SHRED, fooType, false);
Foo*foo= (Foo*)OBJ_MEMBER_UINT(foo_obj, foo_data_ptr_offset);
// ideally, `foo_ctor` has been called and memory has been allocated// but from my logging, foo_ctor is actually never calledstrcpy(foo->buff, "this will segfault");
RETURN->v_obj=foo_obj;
}
The text was updated successfully, but these errors were encountered:
For chugins, the API->object->create() method does not invoke the constructor of the type it creates.
E.g.
The text was updated successfully, but these errors were encountered: