From b93aafaba964d2ffb70c4afd21689e0cc9e877cd Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 11 Jul 2007 08:32:57 +0000 Subject: [PATCH] Avoid a crash due to OnSize being called before initialisation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47331 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/grid.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 945a7914bc..47fc186875 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -4221,6 +4221,7 @@ bool wxGrid::Create(wxWindow *parent, wxWindowID id, Create(); SetInitialSize(size); + CalcDimensions(); return true; } @@ -6953,8 +6954,11 @@ void wxGrid::Refresh(bool eraseb, const wxRect* rect) void wxGrid::OnSize(wxSizeEvent& WXUNUSED(event)) { - // update our children window positions and scrollbars - CalcDimensions(); + if (m_targetWindow != this) // check whether initialisation has been done + { + // update our children window positions and scrollbars + CalcDimensions(); + } } void wxGrid::OnKeyDown( wxKeyEvent& event )