X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/95fa881e92cb5284be976d5c7267a03e5fb4c7ab..b53aea81d2e102224b452ef5bf7aee1132f37c6f:/src/common/init.cpp?ds=inline diff --git a/src/common/init.cpp b/src/common/init.cpp index 49e211f064..d9d3cf0dc7 100644 --- a/src/common/init.cpp +++ b/src/common/init.cpp @@ -269,7 +269,7 @@ static bool DoCommonPostInit() } // yes; test if it implements Clone() correctly - wxEvent* test = dynamic_cast(ci->CreateObject()); + wxEvent* test = wxDynamicCast(ci->CreateObject(),wxEvent); if (test == NULL) { wxLogWarning("The event class '%s' should have a DECLARE_DYNAMIC_CLASS macro!", @@ -282,6 +282,7 @@ static bool DoCommonPostInit() wxLogWarning("The event class '%s' does not correctly implement Clone()!", ci->GetClassName()); + delete cloned; delete test; } #endif