Ok, I fixed (not sure how robust) my copy of the editor. I see a lot of static object variables used in classes rather than pointers to objects created on the heap. Those static objects are all created on the stack and I'm not sure if that is a good thing or not.
I changed the Node class by making the IND_Entity2d variable a pointer to the object. I modified Node ctor by new'ing a IND_Entity2d and its destructor deletes it after calling Entity2dManager->Delete ().
That only revealed another bug. In Listener::ListenEditing() you turn off the grid for the current node the mouse is hovering over.
Code:
if (m_pBackDropNodeOver)
{
m_pBackDropNodeOver->GetEntity()->ShowGridAreas (false);
}
I get a crash on GetEntity because the current entity is now gone. For some reason the variable is 0xfeeefeee instead of 0x00000000. Like I said my solution may not be robust AND I'm not modifying nor to I fully understand the object management in the library.
Code:
if (m_pIndieLib->Input->OnKeyPress(IND_DELETE))
{
m_pMap->DeleteNode (m_pBackDropNodeOver); // Erase the node from the map vector
m_pBackDropNodeOver = NULL; <---- added this
}
In Listener I added the addition shown above and deleting seems to work now. Again, I'm not sure how robust this is.
Steve