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
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)