Get rid of unnecessary wxCriticalSectionLocker use

No real changes, just don't lock a critical section for a short time
only to lock it again almost immediately after unlocking -- just combine
both blocks for which it is locked into one, there is no reason to
release it for TASKDIALOGCONFIG and wxMSWTaskDialogConfig initialization
which are both trivial operations not involving any callbacks.
This commit is contained in:
Vadim Zeitlin
2017-11-08 21:02:38 +01:00
parent 3d98129b51
commit 83b9fa3119

View File

@@ -1047,22 +1047,16 @@ void wxProgressDialog::UpdateExpandedInformation(int value)
void* wxProgressDialogTaskRunner::Entry()
{
// If we have a parent, we must use it to have correct Z-order and icon,
// but this can only be done if we attach this thread input to the thread
// that created the parent window, i.e. the main thread.
wxWindow* parent = NULL;
{
wxCriticalSectionLocker locker(m_sharedData.m_cs);
parent = m_sharedData.m_parent;
}
WinStruct<TASKDIALOGCONFIG> tdc;
wxMSWTaskDialogConfig wxTdc;
{
wxCriticalSectionLocker locker(m_sharedData.m_cs);
wxTdc.parent = parent;
// If we have a parent, we must use it to have correct Z-order and
// icon, even if this comes at the price of attaching this thread input
// to the thread that created the parent window, i.e. the main thread.
wxTdc.parent = m_sharedData.m_parent;
wxTdc.caption = m_sharedData.m_title.wx_str();
wxTdc.message = m_sharedData.m_message.wx_str();