Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
widgets: Cleanup objects in destructors and minor code cleanup
[xestiacalendar/.git] / source / widgets / XCCalendarList.cpp
index 4ee85ac..92e7c50 100644 (file)
@@ -25,21 +25,25 @@ XCCalendarList::XCCalendarList(wxWindow *parent)
                
        szrMain = new wxBoxSizer( wxVERTICAL );
        this->SetSizer(szrMain);
-       this->SetSize(wxSize(350, 500));
-
-       //scwMain = new wxScrolledWindow();
-       
-       //szrScrolled = new wxBoxSizer( wxHORIZONTAL );
-       //scwMain->SetSizer(szrScrolled);
-               
-       //szrMain->Add(scwMain, 0, wxEXPAND, 5);
-       //szrMain->Layout();
-       
+       this->SetSize(wxSize(350, 500));        
                
 }
 
 XCCalendarList::~XCCalendarList(){
        
+       // Delete the calendar lists.
+       
+       for (vector<XCCalendarListAccountCtrl*>::iterator accountCtrlIter = accountControlList.begin();
+               accountCtrlIter != accountControlList.end(); accountCtrlIter++){
+               
+               delete *accountCtrlIter;
+                       
+       }
+       
+       accountControlList.clear();
+       
+       this->SetSizer(nullptr, true);
+       
 }
 
 void XCCalendarList::UpdateCalendarList(CalendarDataStorage *dataStorage){
@@ -122,6 +126,8 @@ void XCCalendarList::UpdateCalendarList(CalendarDataStorage *dataStorage){
        // Set the updated checksum.
        
        checksumUpdate = currentChecksum.checksumValue;
+
+       this->Layout();
        
 }
 
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