From 209a9f58224d3b76fea0d8ce2dc81cf2a5625128 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 5 Nov 2010 21:39:29 +0000 Subject: [PATCH] Don't update scrollbars when the window is being destroyed in wxOSX. Updating scrollbars for a window that is being destroyed anyhow is useless and resulted in crashes in the htlbox sample because it used client-to-screen coordinates conversion which asserted because the TLW was invalid any more and this unexpected assert during window destruction led to a crash. Simply don't do it at all to avoid the problem. Closes #11776. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/window_osx.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index f69b1b717c..25b9abea3a 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -1585,6 +1585,12 @@ void wxWindowMac::SetScrollbar(int orient, int pos, int thumb, int range, bool refresh) { #if wxUSE_SCROLLBAR + // Updating scrollbars when window is being deleted is useless and + // currently results in asserts in client-to-screen coordinates conversion + // code which is used by DoUpdateScrollbarVisibility() so just skip it. + if ( m_isBeingDeleted ) + return; + if ( orient == wxHORIZONTAL && m_hScrollBar ) m_hScrollBar->SetScrollbar(pos, thumb, range, thumb, refresh); else if ( orient == wxVERTICAL && m_vScrollBar ) -- 2.47.2