Added a virtual destructor to the EventHandler class that calls
EventDispatcher::unregisterListener to unregister itself.