Skip to content

bug: same address with diffrent object can't be export #35

@adintr

Description

@adintr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions