Jump to content
  • Advertisement
Sign in to follow this  
Tylon

ScriptString registration

This topic is 4618 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

the asCScriptString class in scriptstring.cpp is registered using asOBJ_CLASS_CDA, but there is no destructor specified. Should it correctly be asOBJ_CLASS_CA, or can you just use asOBJ_CLASS_CDA globally even if you dont use some of the behaviours (construction, destruction and assignment) without any problems? I understand that the reference counting behaviours are defined, so angelscript will just use that to correctly delete the string, but still, is the asOBJ_CLASS_CDA registration parameter correct if there is no destructor specified?

Share this post


Link to post
Share on other sites
Advertisement
The argument asOBJ_CLASS_CDA tells AngelScript how C++ handles the object, not what behaviours will be used by AngelScript.

It's important to tell AngelScript whether the class has constructors, destructors, or the assignment operator defined, because this changes the way C++ passes the class in parameters or the way it is returned by functions.

Regards,
Andreas

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!