From: Vadim Zeitlin Date: Wed, 29 Jun 2011 17:50:30 +0000 (+0000) Subject: Always initialize SelectInHDC::m_hgdiobj in wxMSW. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b02d50281d71a81598449d33d54c1fc5f7c9dd5a?ds=inline Always initialize SelectInHDC::m_hgdiobj in wxMSW. 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 --- diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index 309f4376de..e824c6e5fd 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -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)