Jump to content
  • Advertisement
Sign in to follow this  
wcassella

Custom object handle behavior

This topic is 1039 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

Hi,

 

Currently my game is using a purely Unique/Weak ownership system, which appears to be incompatible with Angelscript's shared handles. Basically I need a way to effectively nullify all handles to objects, or at least make them act like they are null.

 

Would it be possible to do that without modifying the library? Are there any other solutions I can use?

 

Thanks

 

Edit:

 

I should also note that while Angelscript does have a weakref type, I'd prefer that to be the default behavior, at least for objects shared from C++.

Edited by Salty Boyscouts

Share this post


Link to post
Share on other sites
Advertisement

Unfortunately it is not easy to nullify all handles to objects. It is possible to enumerate everything, but it would be rather slow if you have lots of objects.

 

You don't need register your objects with addref/release behaviours though. Just use the flag asOBJ_NOCOUNT to tell AngelScript that no reference counting is needed. Singletons can be registered with the flag asOBJ_NOHANDLE to tell AngelScript that it may not store additional handles to the type, thus allowing you to control where the object is referenced from.

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!