General Category > Game creators corner

segmentation fault while deleting instance

(1/1)

conan:
Hi,

I have quite a tricky situation. I get a segfault every time I try to delete an instance on the map, deleting it with layer.removeInstance(instance). I am pretty sure I'm doing instance.removeActionListener() and that there is nothing else depending on it. I also tracked the problem and it doesn't happen exactly when I delete the instance but next time the engine pumps(), so it happens on the C++ side.

I'm going crazy because I can't debug this C++ side. Is there any way to get more information from the engine part, some way to run a debugger or get a more verbose explanations why it segfaults?

Thank you so much!

conan:
I figured it out!!!!!!!!!!!!!!!!!!!!!!   ;D

It turned out that I had the cellRenderer.addPathVisual() on those instances and of course when the cell renderer wouldn't find them it would go on strike.

Wow, that was lucky. I'm sorry for cluttering the forum with my nagging, but believe me that by the time I decide to ask something it means that I'm in the border of despair. Hopefully my mistakes will be useful for someone in the future.

Niektory:
Yeah, the engine does have some non-obvious traps like this, unfortunately. There's definitely room for better error reporting. Don't worry about posting your woes here, that's what the forum is for. :)

Navigation

[0] Message Index

Go to full version