Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
widgets: Cleanup objects in destructors and minor code cleanup
[xestiacalendar/.git] / source / widgets / XCCalendarListAccountCtrl.cpp
index 46d0e36..dbd105e 100644 (file)
@@ -37,7 +37,7 @@ XCCalendarListAccountCtrl::XCCalendarListAccountCtrl(wxWindow* parent, string ac
        
        // 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.
                
@@ -61,6 +61,12 @@ XCCalendarListAccountCtrl::~XCCalendarListAccountCtrl(){
        
        // 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++){
        
@@ -73,6 +79,14 @@ XCCalendarListAccountCtrl::~XCCalendarListAccountCtrl(){
        calendarControlList.clear();
        
        // Clear the widget controls.
+
+       delete chkShowAll;
+       chkShowAll = nullptr;
+       
+       delete lblAccountName;
+       lblAccountName = nullptr;
+
+       this->SetSizer(nullptr, true);
        
 }
 
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy