From 0b380e6f4fe207b8bd94446dff71aef97e75f744 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 May 2026 22:08:48 +0200 Subject: [PATCH] Avoid debug warnings from wxPropertyGridManager::Create() Skip calling Init2(), which assumes that the window has been successfully created, if base class Create() failed. See #26433. --- src/propgrid/manager.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index 5d562e71cd..28df24d4b8 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -628,16 +628,18 @@ bool wxPropertyGridManager::Create( wxWindow *parent, if ( !m_pPropGrid ) m_pPropGrid = CreatePropertyGrid(); - bool res = wxPanel::Create( parent, id, pos, size, - (style & wxWINDOW_STYLE_MASK)|wxWANTS_CHARS, - name ); + if ( !wxPanel::Create( parent, id, pos, size, + (style & wxWINDOW_STYLE_MASK)|wxWANTS_CHARS, + name ) ) + return false; + Init2(style); SetInitialSize(size); // Create controls RecreateControls(); - return res; + return true; } // -----------------------------------------------------------------------