From 8168167976dc3cc5f5223a21e1a62ba91a4f77b3 Mon Sep 17 00:00:00 2001
From: Stefan Csomor <csomor@advancedconcepts.ch>
Date: Fri, 20 Oct 2006 11:01:50 +0000
Subject: [PATCH] avoiding nesting dcs on the same window concurrently

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42157 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 src/generic/statusbr.cpp | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/generic/statusbr.cpp b/src/generic/statusbr.cpp
index 958d61a5d9..163c13cab3 100644
--- a/src/generic/statusbr.cpp
+++ b/src/generic/statusbr.cpp
@@ -81,13 +81,14 @@ bool wxStatusBarGeneric::Create(wxWindow *parent,
     SetFont(*wxSMALL_FONT);
 #endif
 
-    // Set the height according to the font and the border size
-    wxClientDC dc(this);
-    dc.SetFont(GetFont());
-
-    wxCoord y;
-    dc.GetTextExtent(_T("X"), NULL, &y );
-
+	wxCoord y;
+	{
+		// Set the height according to the font and the border size
+		wxClientDC dc(this);
+		dc.SetFont(GetFont());
+
+		dc.GetTextExtent(_T("X"), NULL, &y );
+	}
     int height = (int)( (11*y)/10 + 2*GetBorderY());
 
     SetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, height);
-- 
2.47.2