Add check for destroying window with mouse capture in wxGTK.

We already have an assert checking for this at wxWindowBase level but it seems
that it wasn't always triggered somehow (maybe because we crashed before
getting there?), so do it sooner.

Closes #14602.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73000 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2012-11-24 00:33:19 +00:00
parent 395506ea99
commit 7df04680cb

View File

@ -2380,6 +2380,16 @@ wxWindowGTK::~wxWindowGTK()
if ( gs_deferredFocusOut == this )
gs_deferredFocusOut = NULL;
// Unlike the above cases, which can happen in normal circumstances, a
// window shouldn't be destroyed while it still has capture, so even though
// we still reset the global pointer to avoid leaving it dangling and
// crashing afterwards, also complain about it.
if ( g_captureWindow == this )
{
wxFAIL_MSG( wxS("Destroying window with mouse capture") );
g_captureWindow = NULL;
}
if (m_widget)
GTKDisconnect(m_widget);
if (m_wxwindow && m_wxwindow != m_widget)