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
This commit is contained in:
Vadim Zeitlin
2010-11-05 21:39:29 +00:00
parent df7d93f67b
commit 209a9f5822

View File

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