Don't leak memory when receiving TaskbarButtonCreated messages.
It is possible to receive more than one TaskbarButtonCreated message for the same window, so at the very least don't leak memory if this happens. We really ought to notify the application to allow it to reinitialize the taskbar button in this case though. See #16566. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -991,7 +991,13 @@ WXLRESULT wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPara
|
||||
#if wxUSE_TASKBARBUTTON
|
||||
if ( message == wxMsgTaskbarButtonCreated )
|
||||
{
|
||||
m_taskBarButton = wxTaskBarButton::New(this);
|
||||
if ( !m_taskBarButton )
|
||||
m_taskBarButton = wxTaskBarButton::New(this);
|
||||
//else: If we get this message again, it may mean that our old taskbar
|
||||
// button can't be used any more and needs to be recreated. We
|
||||
// need to check whether this is really the case and sent a
|
||||
// special event to allow the user code to react to this.
|
||||
|
||||
processed = true;
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user