From 25d9faca17d89e06cf6fe34ef2425486c59a0e44 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 28 Oct 2017 01:26:42 +0200 Subject: [PATCH] Remove state assigning from wxProgressDialog::GetHandle() This was added in 01bd848eb9699a60e0bdd5105b9a9c591c9e1b20 without any explanation and probably was a copy-and-paste typo as it just doesn't make any sense to change the state of the dialog in this accessor function (and if the state doesn't change, then this assignment is just completely useless). Remove the apparently unnecessary assignment and also an unnecessary temporary variable. --- src/msw/progdlg.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/msw/progdlg.cpp b/src/msw/progdlg.cpp index 202a09b360..f6df346553 100644 --- a/src/msw/progdlg.cpp +++ b/src/msw/progdlg.cpp @@ -576,13 +576,8 @@ WXWidget wxProgressDialog::GetHandle() const #ifdef wxHAS_MSW_TASKDIALOG if ( HasNativeTaskDialog() ) { - HWND hwnd; - { - wxCriticalSectionLocker locker(m_sharedData->m_cs); - m_sharedData->m_state = m_state; - hwnd = m_sharedData->m_hwnd; - } - return hwnd; + wxCriticalSectionLocker locker(m_sharedData->m_cs); + return m_sharedData->m_hwnd; } #endif return wxGenericProgressDialog::GetHandle();