// Setup the label.
- lblAccountName = new wxStaticText(this, wxID_ANY, wxString(accountName), wxDefaultPosition, wxDefaultSize, 0, "");
+ lblAccountName = new wxStaticText(this, wxID_ANY, wxString(accountName.c_str(), wxConvUTF8), wxDefaultPosition, wxDefaultSize, 0, "");
// Setup the font.
// Delete the calendar controls.
+ // Unbind the controls.
+
+ chkShowAll->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxMouseEventHandler(XCCalendarListAccountCtrl::ShowAllCheckboxClick), NULL, this);
+
+ // Delete the calendar list controls.
+
for (std::vector<XCCalendarListCalendarCtrl*>::iterator calendarIter = calendarControlList.begin();
calendarIter != calendarControlList.end(); calendarIter++){
calendarControlList.clear();
// Clear the widget controls.
+
+ delete chkShowAll;
+ chkShowAll = nullptr;
+
+ delete lblAccountName;
+ lblAccountName = nullptr;
+
+ this->SetSizer(nullptr, true);
}