Preparing contexs and Script Object life time
So, I have a script context that I keep around and run all my script stuff in.
One thing I do with it is instance a script side class.
Now it is my impression that Script Object life times are dependent on 2 things:
1) Internal reference count
2) Lifetime of the context they were created in
Thus, as long as I don't release my reference to the script object, and as long as I don't delete the context they were created in, they should be alive.
But it seems that, as soon as I Prepare() the context again, (in this case, in order to call a method on the script object in question), my asIScriptObject pointer becomes invalid.
So it seems that Prepare() is invalidating my object, is this the expected functionality? And if so, how do I keep my Script Objects alive?
Just to be sure, you are calling AddRef() on the script object when you store the pointer, right?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement