fix for exception in finaliser of wxObject and EvtHandler