Get child call is time bomb (for me)

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
corran
Posts: 8
Joined: Wed Jan 12, 2005 6:39 pm

Get child call is time bomb (for me)

Post by corran »

i'm using a modified version(butchered version) of irrlicht and it continually kills my program when i
1. get children of a node ( and the node has children )
2. then try to delete the node or do any thing that results in a call to a function with

Code: Select all

(*it)->Parent = 0;
(*it)->Drop();
i believe that the program dies when the call (*it)->Parent = 0; is made
now while my app is not using straight up irrlicht release the scenenode class, and linked list class are unmodified (except for cosmetic changes)
but what would be causing this error? i cant find any problem with the iterator and the memory location is valad
blah.... i'm geting ready to give up on this and move on to something eles

oh yes i'm using devc++ c++ project and there are no compile time errors
just this runtime one
Guest

Post by Guest »

Are you using setParent or removeChild to remove the child from the parent, or are you doing that Parent assignment yourself?
corran
Posts: 8
Joined: Wed Jan 12, 2005 6:39 pm

Post by corran »

the error occurs in
removeChild(ISceneNode* child) and removeAll()

but i only call Remove() and removeAll
i've checked the pointers when the object is created and when the call is made and i've also tries adding a function that calls Parent = 0 and nothing else
Guest

Post by Guest »

OK. So can you reproduce the error with a "non-butchered" version of Irrlicht?

If so, you should probably file it as a bug.

If not, you've narrowed it down to a probable error in your modifications.
Guest

Post by Guest »

yes i have recreated an error with the gcc release of irrlicht however it does not kill the program
the bomb only goes off because of my overloaded new functionsbut the error is still there


tryed this
in example 3 custom scene node irr ver10
create 3 nodes instead of one add the sceond and third as children to the first
then i got the children and iterated throught them printing out the memory locations they hold
two printed out
then i called the RemoveAll function of node 1 which should have removed all the children
then i got the children and iterated though the list again
1 memory location printed out

when i tried this with my overloaded new/deletes and memory pool the program promptly died
im not sure whats going on as but i believe my compiler/linker is not working right, as i can't see any problems looking through the code
the error seems to stem from the how getchildren returns a refrence to the children variable

i'll post my test apps and their sources when i get back to my computer but if any one else can use that giberish above to recreate that problem with devc++ please... help me *wimper
Post Reply