]> git.saurik.com Git - wxWidgets.git/commitdiff
Always initialize SelectInHDC::m_hgdiobj in wxMSW.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 29 Jun 2011 17:50:30 +0000 (17:50 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 29 Jun 2011 17:50:30 +0000 (17:50 +0000)
Leaving m_hgdiobj uninitialized probably didn't result in any problems
considering how this class is currently used but it did result in g++ warnings
about uninitialized member with aggressive warning flags and also could easily
become a problem in the future so just ensure that we always initialize it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68099 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/private.h

index 309f4376de1de9ed9ae3fcc62d0525cd6fd013b3..e824c6e5fdcf188aec0ba44c24700103afd75429 100644 (file)
@@ -454,7 +454,7 @@ private:
     void DoInit(HGDIOBJ hgdiobj) { m_hgdiobj = ::SelectObject(m_hdc, hgdiobj); }
 
 public:
-    SelectInHDC() : m_hdc(NULL) { }
+    SelectInHDC() : m_hdc(NULL), m_hgdiobj(NULL) { }
     SelectInHDC(HDC hdc, HGDIOBJ hgdiobj) : m_hdc(hdc) { DoInit(hgdiobj); }
 
     void Init(HDC hdc, HGDIOBJ hgdiobj)