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
TestCode:
class A
{
public:
int getVal() const { return m_a; }
private:
int m_a = 10;
};
class B
{
public:
A* getA() {
return &m_a;
}
private:
A m_a;
};
...
static B test;
dukglue_register_method(m_ctx, &A::getVal, "getVal");
dukglue_register_method(m_ctx, &B::getA, "getA");
dukglue_register_global(m_ctx, &test, "test");
...
run script "test.getA().getVal()" get an error.
test.getA() not return the object of type A, return value still B.
the script "test.getA().getA().getA()" is good.
In C++, diffrent object maybe have same address, but when export to dukglue, it buffered address and object, same address always be the object first export.
The text was updated successfully, but these errors were encountered:
TestCode:
class A
{
public:
int getVal() const { return m_a; }
private:
int m_a = 10;
};
class B
{
public:
A* getA() {
return &m_a;
}
private:
A m_a;
};
...
static B test;
dukglue_register_method(m_ctx, &A::getVal, "getVal");
dukglue_register_method(m_ctx, &B::getA, "getA");
dukglue_register_global(m_ctx, &test, "test");
...
run script "test.getA().getVal()" get an error.
test.getA() not return the object of type A, return value still B.
the script "test.getA().getA().getA()" is good.
In C++, diffrent object maybe have same address, but when export to dukglue, it buffered address and object, same address always be the object first export.
The text was updated successfully, but these errors were encountered: