CreateScriptObject problem
Hi
I've got a problem where CreateScriptObject returns a pointer to an uninitialized piece of memory (0xcdcdcdcd in debug VC8 build). The object I'm trying to create is a script declared class with a bunch of members and methods. If I add an empty or simple constructor to the class it will instead return a null pointer. (I did a quick trace of the constructor execution inside CreateScriptObject, and on the second system call it does, the first being to some GC_AddRef or something, it gets a null pointer exception. That is, a script null ptr exception, not a system "real memory" exception.)
I've got no idea what's going on... I've tried comparing to the test_scriptclassmethod test, but can't find any obvious differences, except that my class exists in a module.
Don't know what more info to give, but I'll keep investigating. Just wondering if anyone (i.e. WitchLord :) has got any idea.
Thanks in advance
/Anders
EDIT: Just FYI, I'm using the 2.6.0 release.
Just noticed that if I change the test_scriptclassmethod example to put the script2 script in another module (and update everything that accesses it to specify that module), CreateScriptObject returns 0 too. This time, however, because the constructor context can't be prepared.
I don't understand much what's going on here. Any help is welcome. :)
/Anders
I don't understand much what's going on here. Any help is welcome. :)
/Anders
I'll try to reproduce this problem in order to determine what's going on.
It sounds like a bug in AngelScript though.
Thanks for letting me know.
Regards,
Andreas
It sounds like a bug in AngelScript though.
Thanks for letting me know.
Regards,
Andreas
I managed to reproduce the problem the way you mentioned, and I know where the problem is: The ids for the script class methods don't reflect which module they were declared in. Unfortunately this was a situation that I overlooked and the solution is not so simple.
I'll have to think about this a little and decide upon a solution.
I'll have to think about this a little and decide upon a solution.
Ah, okay. Thanks.
You might want to think about a way then to get the module a type id resides in too, since I found no way to do that as it is now (which I guess might be related). I mean... Currently, I can't for example get the method of a class by declaration if I haven't previously stored which module the type id was found in.
Hope that made sense. :)
You might want to think about a way then to get the module a type id resides in too, since I found no way to do that as it is now (which I guess might be related). I mean... Currently, I can't for example get the method of a class by declaration if I haven't previously stored which module the type id was found in.
Hope that made sense. :)
Good point. :)
I seem to have overlooked quite a big part with this design. Fortunately getting the module id from the type id is easy, though it requires a new method to the engine interface.
I seem to have overlooked quite a big part with this design. Fortunately getting the module id from the type id is easy, though it requires a new method to the engine interface.
Sounds good :)
Don't want to push it, but is there any ETA for these fixes? They're kind of a showstopper for me. :)
Don't want to push it, but is there any ETA for these fixes? They're kind of a showstopper for me. :)
You can be assured that this is a high priority for me, as I consider it to be a bug, not a new feature. Maybe I can have a fix ready for the weekend, but I can't guarantee anything.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement