From 870a5453450f988c0fdd085e791e2308f82122cd Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Sat, 19 Sep 2015 17:51:56 +0200 Subject: [PATCH] Fix recently introduced crash in MSW wxTaskbarButton::New() Fixed regression introduced in f7458dd03f29d3280006b8875a156b7b09be7257 ("Use wxComPtr<> instead of raw pointers in wxTaskbarButton code", see #16557). Closes https://github.com/wxWidgets/wxWidgets/pull/96 --- src/msw/taskbarbutton.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/msw/taskbarbutton.cpp b/src/msw/taskbarbutton.cpp index 577e58315f..5b5308bfe8 100644 --- a/src/msw/taskbarbutton.cpp +++ b/src/msw/taskbarbutton.cpp @@ -698,7 +698,7 @@ bool wxThumbBarButton::UpdateParentTaskBarButton() /* static */ wxTaskBarButton* wxTaskBarButton::New(wxWindow* parent) { - wxCOMPtr taskbarList; + wxITaskbarList3* taskbarList = NULL; HRESULT hr = CoCreateInstance ( @@ -720,6 +720,7 @@ wxTaskBarButton* wxTaskBarButton::New(wxWindow* parent) // This is however unexpected. wxLogApiError(wxT("ITaskbarList3::Init"), hr); + taskbarList->Release(); return NULL; }