EntityParent busted with Linkedlist

Blitz3D Forums/Blitz3D Programming/EntityParent busted with Linkedlist

Shifty Geezer(Posted 2005) [#1]
I've added list functionality to my Object. It's working fine and dandy except for a peculiar problem. If I delete several objects and add an object, when I call EntityParent mdl_arrow,ODE_object_list\current\mesh I'm told 'Entity does no exist'. But both have values mdl_arrow=32679648 and ODE_object_list\current\mesh=32394568.

I set all values to 0 after deleting objects or entities so the value in ODE_object_list\current\mesh is only>0 when I create a mesh, and don't touch mdl_value after loading the mesh. How can EntityParent fail to find both entites when they both exist?


big10p(Posted 2005) [#2]
Are you sure both entities exist? Remember, when you FreeEntity, all it's children are freed, also.


Banshee(Posted 2005) [#3]
I had to admit i'm more inclined to think the leak is in your code than in the Blitz3D code on this one. Try using the nextChild() code from the codebase to search an entity when deleting it to make sure that you are not deleting any children too.


Shifty Geezer(Posted 2005) [#4]
Could a child entity be left with a value but 'disconnected'? that's probbaly it. If I'm deleting the object mdl_arrow is parenteed to then I guess it's freeing the entity but the memory pointer remains. I'll investigate...


Shifty Geezer(Posted 2005) [#5]
That was it. When a child is free'd because it's parent is, it's memory pointer isn't set to zero. Many thanks - this would'a taken me forever to find myself!


Shifty Geezer(Posted 2005) [#6]
That was it. When a child is free'd because it's parent is, it's memory pointer isn't set to zero. Many thanks - this would'a taken me forever to find myself!