Fix memory leak in taskbarbutton sample

wxTaskBarButton::RemoveThumbBarButton() removes the button but does not
delete it. In the sample removed buttons must be deleted manually
because they are also removed from m_thumbBarButtons which automatically
deletes the stored buttons in its destructor.

Closes https://github.com/wxWidgets/wxWidgets/pull/778
This commit is contained in:
PB 2018-04-07 22:01:18 +02:00 committed by Vadim Zeitlin
parent 748c0150c2
commit f9aeb2669b

View File

@ -429,7 +429,7 @@ void MyFrame::OnRemoveThubmBarButton(wxCommandEvent& WXUNUSED(event))
wxThumbBarButton* button = m_thumbBarButtons.back();
m_thumbBarButtons.pop_back();
MSWGetTaskBarButton()->RemoveThumbBarButton(button);
delete MSWGetTaskBarButton()->RemoveThumbBarButton(button);
}
void MyFrame::OnThumbnailToolbarBtnClicked(wxCommandEvent& event)