From 991e4a9c0f5273f903356c771d117287dde800dc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 5 Nov 2013 13:39:53 +0000 Subject: [PATCH] Ignore system colour change events in not yet initialized wxPropertyGrid. Handling these events before the initialization was over could result in a crash because m_categoryDefaultCell wasn't yet initialized when the window was created. Fix this by ignoring these events during initialization. Closes #15642. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75128 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/propgrid.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 63b5099321..7e6628c825 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -1297,8 +1297,10 @@ void wxPropertyGrid::CalculateFontAndBitmapStuff( int vspacing ) void wxPropertyGrid::OnSysColourChanged( wxSysColourChangedEvent &WXUNUSED(event) ) { - RegainColours(); - Refresh(); + if ((m_iFlags & wxPG_FL_INITIALIZED)!=0) { + RegainColours(); + Refresh(); + } } // -----------------------------------------------------------------------