From e32703a9d76b180e09571a7a0a5e8a2866c329ae Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 24 May 2005 11:46:45 +0000 Subject: [PATCH] don't use dangling HBRUSH git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34317 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/notebook.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 4b02f0bc09..f5aa19e983 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -802,8 +802,12 @@ void wxNotebook::OnPaint(wxPaintEvent& WXUNUSED(event)) // if there is no special brush just use the solid background colour HBRUSH hbr = (HBRUSH)m_hbrBackground; + wxBrush brush; if ( !hbr ) - hbr = GetHbrushOf(wxBrush(GetBackgroundColour())); + { + brush = wxBrush(GetBackgroundColour()); + hbr = GetHbrushOf(brush); + } ::FillRect(GetHdcOf(memdc), &rc, hbr); -- 2.45.2