Hello,
I have a line in AngleScript:
WeakHandle weakGridHandle = gridworld.GetGrid(gridworld.RealToGrid(node.position)); currentGrid = weakGridHandle.Get();
The function GetGrid returns a WeakPtr.
However whenever these lines are run, i get an assert error in ReCounted::AddRef() on the c++ side.
Both gridWorld and grid objects are registered in c++:
RegisterObject<GridWorld>(engine, "GridWorld"); RegisterObject<Grid>(engine, "Grid");
And the registration for the function that causes the issue:
engine->RegisterObjectMethod(“GridWorld”, “Grid& GetGrid(Vector3 globalPos)”, asMETHODPR(GridWorld, GetGrid, (Vector3), WeakPtr<Grid>), asCALL_THISCALL);
Grid is directly derived from Object.
Any Ideas of what i could be missing?
Thanks, Trevor