X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6bc807b35dd64472634549aa219107a8044072ca..9e1fc0e42822fdf1159582f1b73cde0c7d15bc92:/src/generic/calctrl.cpp?ds=sidebyside diff --git a/src/generic/calctrl.cpp b/src/generic/calctrl.cpp index f10b5015ca..2fb1c41725 100644 --- a/src/generic/calctrl.cpp +++ b/src/generic/calctrl.cpp @@ -202,6 +202,9 @@ bool wxCalendarCtrl::Create(wxWindow *parent, long style, const wxString& name) { + // set the style first to avoid assert in our SetWindowStyleFlag() + m_windowStyle = style; + if ( !wxControl::Create(parent, id, pos, size, style | wxCLIP_CHILDREN | wxWANTS_CHARS | wxFULL_REPAINT_ON_RESIZE, wxDefaultValidator, name) ) @@ -253,6 +256,14 @@ wxCalendarCtrl::~wxCalendarCtrl() { delete m_attrs[n]; } + + if ( !HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) ) + { + delete m_comboMonth; + delete m_staticMonth; + delete m_spinYear; + delete m_staticYear; + } } void wxCalendarCtrl::SetWindowStyleFlag(long style)