Be more paranoid about parent window possibly being NULL (partly fixes #11115).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61905 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis 2009-09-13 15:48:40 +00:00
parent bf24fcddc3
commit adfe31645d
2 changed files with 10 additions and 4 deletions

View File

@ -63,8 +63,11 @@ bool wxSpinButton::Create(
m_windowId = NewControlId();
else
m_windowId = vId;
m_backgroundColour = pParent->GetBackgroundColour();
m_foregroundColour = pParent->GetForegroundColour();
if (pParent)
{
m_backgroundColour = pParent->GetBackgroundColour();
m_foregroundColour = pParent->GetForegroundColour();
}
SetName(rsName);
SetParent(pParent);
m_windowStyle = lStyle;

View File

@ -126,8 +126,11 @@ bool wxSpinCtrl::Create( wxWindow* pParent,
m_windowId = NewControlId();
else
m_windowId = vId;
m_backgroundColour = pParent->GetBackgroundColour();
m_foregroundColour = pParent->GetForegroundColour();
if (pParent)
{
m_backgroundColour = pParent->GetBackgroundColour();
m_foregroundColour = pParent->GetForegroundColour();
}
SetName(rsName);
SetParent(pParent);
m_windowStyle = lStyle;