under what circumstace can freeentity crash?

BlitzMax Forums/MiniB3D Module/under what circumstace can freeentity crash?

jkrankie(Posted 2009) [#1]
I'm having a little trouble freeing a particular entity, which i've traced to being the player entity. The point at which it crashes is when MiniB3D is trying to remove it from it's list of entities with and 'Unhandled Exeption: attempt to access field or method of null object'. I am at no point freeing or nullifying the player object, or the entity used to represent it. So what's going on?


I'm not doing much other than moving and rotating it, the only slightly odd thing i'm doing to it is changing it's collision type from 1 to 5 and back again when the player dies.

Cheers
Charlie


slenkar(Posted 2009) [#2]
can you create a small demo?


Shagwana(Posted 2009) [#3]
Minimize it to the bare minimum, removing code that is not causing the crash.
What you have left is either the bug or a error in your code!


jkrankie(Posted 2009) [#4]
The plot thickens, i can successfully call entityx(p1.entity), but freeentity p1.entity at the exact same place in code crashes.

Cheers
Charlie


Warner(Posted 2009) [#5]
Try opening up TEntity.bmx in the editor, turn on Debug mode, and run the example. That should show/trace the line it crashes on. Does the entity has any childs? The error could occur when one of them is freed.