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:
parent
748c0150c2
commit
f9aeb2669b
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user