X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d6f93922574f0733fde4817445c3575398e2bf7a..57bf907d8e45ced18486d74c04f41c06034b7e65:/src/osx/toplevel_osx.cpp diff --git a/src/osx/toplevel_osx.cpp b/src/osx/toplevel_osx.cpp index 1886e988c9..738b5d607d 100644 --- a/src/osx/toplevel_osx.cpp +++ b/src/osx/toplevel_osx.cpp @@ -87,6 +87,17 @@ wxTopLevelWindowMac::~wxTopLevelWindowMac() { } +bool wxTopLevelWindowMac::Destroy() +{ + // NB: this will get called during destruction if we don't do it now, + // and may fire a kill focus event on a control being destroyed +#if wxOSX_USE_CARBON + if (m_nowpeer->GetWXWindow()) + ClearKeyboardFocus( (WindowRef)m_nowpeer->GetWXWindow() ); +#endif + return wxTopLevelWindowBase::Destroy(); +} + // ---------------------------------------------------------------------------- // wxTopLevelWindowMac maximize/minimize