setScale and getScale crash my program (SOLVED: MY FAULT)

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
FumarMata
Posts: 13
Joined: Fri Mar 02, 2007 12:26 pm

setScale and getScale crash my program (SOLVED: MY FAULT)

Post by FumarMata »

Hello everybody

It seems that a setScale is crashing my program. I want to change the scale.Y of an array of objects. Everything goes fine, but after a while, 10-15 seconds, the program crashes

If I comment the setScale command, the program doesn't crash

Code: Select all


core::vector3df scule;

...

while(device->run()) {
    for(int i=0;i<numamp; i++){
        for(int k=0;k<numalc; k++){
            scule.Y =hfinalarea[i][k];
            nodeW[i][k]->setScale(scule);
        }
    }
}


I'm stuck in this... could you help me? :?

Thanks!

marc
Last edited by FumarMata on Fri Mar 16, 2007 9:28 pm, edited 1 time in total.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

I'd be willing to bet that the problem is not with setScale(). Are you absolutely sure that the scene node pointer stored at nodeW[k] is not an invalid pointer?
FumarMata
Posts: 13
Joined: Fri Mar 02, 2007 12:26 pm

Post by FumarMata »

Hello Vitek

Yes, I'm completely sure, because the movie works during a few seconds, changing the scale of the nodes till it crashes

I have also changed numalc and numamp for absolute values to be sure that nodeW[k] is a valid pointer, but it made it crash too

Now I think that the problem is related to the mysql library / queries that I'm using...

Do you know a way to debug this (software, technique,...)? I'm using dev-c++

(still stuck :? )

Thanks
FumarMata
Posts: 13
Joined: Fri Mar 02, 2007 12:26 pm

Post by FumarMata »

I forgot to say: also, if I try to getscale, instead of set the scale, it crashes too...
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Which makes it pretty sure that you're invalidating your pointers somehow. Maybe some other code is overwriting the array? Or you drop() some elements?
FumarMata
Posts: 13
Joined: Fri Mar 02, 2007 12:26 pm

Post by FumarMata »

Hello Hybrid

Which ways could I be invalidating my pointers? (I’m not dropping any element)
-overwritting the array
-some others?

This way I'll check this later. Could a pointer to a variable length string (the mysql query) be interfering with that?

Sorry for my imprecision... I'm really newbie on all this

Thanks!
FumarMata
Posts: 13
Joined: Fri Mar 02, 2007 12:26 pm

Post by FumarMata »

Buf!

Finally I found the problem... I was not checking correctly the data that I was getting from the database, so at a certain point I was referencing to a node that didn't exist => CRASH!

Sorry for annoying you with this stuff :s

Thanks

marc
Post Reply