Advertisement

Preparing contexs and Script Object life time

Started by May 21, 2009 02:41 PM
1 comment, last by Wavesonics 15 years, 6 months ago
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?
==============================
A Developers Blog | Dark Rock Studios - My Site
Just to be sure, you are calling AddRef() on the script object when you store the pointer, right?
Advertisement
Nope, nope i wasn't, thanks again SiCrane!
==============================
A Developers Blog | Dark Rock Studios - My Site

This topic is closed to new replies.

Advertisement