Jump to content
  • Advertisement
Sign in to follow this  
iram

invalid pointer to class registered

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

i encountered errors with registered classes in angelscript 2.5c. C3D p3D; r = engine->RegisterGlobalProperty ("sr3D STARX", &p3D); assert(r >= 0); STARX.printf ("abc"); i get a null pointer exception during execution. is it because i registered too many classes?

Share this post


Link to post
Share on other sites
Advertisement
That is highly unlikely.

It looks like you are registering a variable declared on the stack. Thus when the scope is gone, the variable disappears.

Share this post


Link to post
Share on other sites

i thought it is the scope issue initially.

but now C3D p3D is declared as a global variable to all classes.

Share this post


Link to post
Share on other sites
You'll have to show us more, for us to be able to determine what the problem is.

How is the type sr3D registered?

How is the printf() method registered?

How is the string type registered?

Share this post


Link to post
Share on other sites

i am using another 3D library to provide all the rendering functions, but this library exposes these functions to AngelScript too, via a method call.

what happened is i need to expose my own version of the functions, so i just register the relevant classes i needed to AngelScript.

so if i run my sample without the 3D library exposed to AngelScript, i can get the sr3D pointer and everything is working fine.

just by exposing the 3D library, my sr3D pointer will be invalid. i have debug and found that it points to another address.

how can i check whatever is registered ? i want to trace them and see when the values are altered.


Share this post


Link to post
Share on other sites
Sounds strange to me that the object address would be different just because you expose the 3D library or not. Are you checking all the return codes from AngelScript?

What 3D library are you using? Perhaps there is some known problem with it.

In my design I assumed that the application would know what was registered with the library, therefore there is no existing way of enumerating what is already registered. I'll have to rethink this in a future version and expose methods to do that.

In the meantime you could probably debug the library itself and check what is registered by setting breakpoints in the Register methods.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!