]> git.saurik.com Git - wxWidgets.git/commitdiff
Initialize wxButton::m_authNeeded in ctor and not Create() in wxMSW.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 27 Feb 2011 12:47:43 +0000 (12:47 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 27 Feb 2011 12:47:43 +0000 (12:47 +0000)
Ensure that the member is always initialized as calling GetAuthNeeded() for a
default-constructed button would access a non-initialized variable before.

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

include/wx/msw/button.h
src/msw/button.cpp

index 14e1e708cd0590f86f8540a2b2dcabc84ede2285..5d78464ef494b043cc62452bdfbfcab7da7fcb5c 100644 (file)
@@ -100,6 +100,7 @@ private:
     void Init()
     {
         m_imageData = NULL;
+        m_authNeeded = false;
     }
 
     // Switches button into owner-drawn mode: this is used if we need to draw
index e08d58e3be205d021d25665a2bea92486a16f707..4eea5a4c5abc015dfebfd0aeba4a719985d6d726 100644 (file)
@@ -450,8 +450,6 @@ bool wxButton::Create(wxWindow *parent,
                       const wxValidator& validator,
                       const wxString& name)
 {
-    m_authNeeded = false;
-
     wxString label(lbl);
     if (label.empty() && wxIsStockID(id))
     {