Advertisement

Array with objects handles

Started by March 03, 2017 10:01 AM
2 comments, last by Alexander Orefkov 7 years, 9 months ago

I was used 2.30 version and has that code:


interface ISomeIface {
...
};
array<ISomeIface@> ifaces;

void func(ISomeIface& i) {
    ifaces.insertLast(i);
}

And that work fine.

Now I upgrade to last svn version, and code become fall with exception. I debug it - in CScriptArray::SetValue value sended as pointer, not as handle, but template subtype has asTYPEID_OBJHANDLE flag and do unreference, that broke all.

It worked, if I change code as:


void func(ISomeIface@ i) {
    ifaces.insertLast(i);
}

or

void func(ISomeIface& i) {
    ifaces.insertLast(@i);
}

What wrong in my first code? Why behavior is changed? Seems early compiler automatically convert value to handle, based on template type.

It appears to be a bug. I will look into this.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement

I've fixed this in revision 2382.

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Many thanks!

This topic is closed to new replies.

Advertisement