X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/89ebf1c919fbd662b2b9440573cf7d268023419c..e7ca6139d062c37cc7c056b6647097e999b714cd:/src/mac/control.cpp diff --git a/src/mac/control.cpp b/src/mac/control.cpp index 29698c6839..f3973a3190 100644 --- a/src/mac/control.cpp +++ b/src/mac/control.cpp @@ -103,11 +103,11 @@ wxControl::~wxControl() m_isBeingDeleted = TRUE; // If we delete an item, we should initialize the parent panel, // because it could now be invalid. - wxPanel *panel = wxDynamicCast(GetParent(), wxPanel); - if ( panel ) + wxWindow *parent = GetParent() ; + if ( parent ) { - if (panel->GetDefaultItem() == (wxButton*) this) - panel->SetDefaultItem(NULL); + if (parent->GetDefaultItem() == (wxButton*) this) + parent->SetDefaultItem(NULL); } if ( m_macControl ) {