X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/89ebf1c919fbd662b2b9440573cf7d268023419c..33754c4d83c59b7523a6da0c4fb21079cb60301c:/src/mac/carbon/control.cpp?ds=sidebyside diff --git a/src/mac/carbon/control.cpp b/src/mac/carbon/control.cpp index 29698c6839..f3973a3190 100644 --- a/src/mac/carbon/control.cpp +++ b/src/mac/carbon/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 ) {