Fixed the segfault on close. wxWidgets prefers to have their Destroy() method called instead of deleting objects manually. Destroy() follows a chain of parent pointers and deletes all children.