Welcome Guest Search | Active Topics | Log In | Register

No sq_getreleasehook() ?
#1 Posted : Wednesday, June 24, 2015 8:47:15 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/25/2014(UTC)
Posts: 61
Location: France

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
It might sound weird, but I didn't found any way to get wether an object has a release hook set or not.
It seems it's just a _hook pointer on objects, that is null or set to a function address.

I currently use the release hook in some of my objects as a way to call native destructors, but also to mean that an instance is owned by Squirrel or not. Currently I have to maintain a flag m_scriptOwnership in my C++ class, but if I could just test the existence of the release hook on the Squirrel instance, I wouldn't need that flag.

Will a sq_getreleasehook() function be added in future versions of Squirrel?
#2 Posted : Thursday, June 25, 2015 8:30:17 AM(UTC)
Rank: Advanced Member

Groups: Registered, Administrators
Joined: 6/11/2005(UTC)
Posts: 1,062

Thanks: 0 times
Was thanked: 80 time(s) in 62 post(s)
fair enough, I'll add that :)

Follow me on Twitter @squirrellang
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Clean Slate theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.140 seconds.