summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2011-10-07 12:45:40 (GMT)
committerJan-Arve Saether <jan-arve.saether@nokia.com>2011-10-07 12:45:40 (GMT)
commita0feeef52efde872c6d6e458c8e15616da0bf74f (patch)
tree8c846d041bbce0ac4f10eac1b1b93250144f7f60 /src/gui/dialogs
parent74251fb0fc57b1e0f7db0b561e4aa4c0347f6f37 (diff)
downloadQt-a0feeef52efde872c6d6e458c8e15616da0bf74f.zip
Qt-a0feeef52efde872c6d6e458c8e15616da0bf74f.tar.gz
Qt-a0feeef52efde872c6d6e458c8e15616da0bf74f.tar.bz2
fix possible race conditions
the initialization guard must be set after the initialization is done; for the code assumed to be only executed in a single thread, this change was done just for consistency - in order to avoid similar issues by copy-pasting in future Merge-request: 2655 Reviewed-by: Jan-Arve Saether <jan-arve.saether@nokia.com>
Diffstat (limited to 'src/gui/dialogs')
-rw-r--r--src/gui/dialogs/qfiledialog_win.cpp3
-rw-r--r--src/gui/dialogs/qwizard_win.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp
index 30f5f18..45f6164 100644
--- a/src/gui/dialogs/qfiledialog_win.cpp
+++ b/src/gui/dialogs/qfiledialog_win.cpp
@@ -97,7 +97,6 @@ static void qt_win_resolve_libs()
}
#endif
- triedResolve = true;
#if !defined(Q_WS_WINCE)
QSystemLibrary lib(QLatin1String("shell32"));
ptrSHBrowseForFolder = (PtrSHBrowseForFolder)lib.resolve("SHBrowseForFolderW");
@@ -112,6 +111,8 @@ static void qt_win_resolve_libs()
if (ptrSHBrowseForFolder && ptrSHGetPathFromIDList && ptrSHGetMalloc)
qt_priv_ptr_valid = true;
#endif
+
+ triedResolve = true;
}
}
diff --git a/src/gui/dialogs/qwizard_win.cpp b/src/gui/dialogs/qwizard_win.cpp
index 9ea114c..00ebbfd 100644
--- a/src/gui/dialogs/qwizard_win.cpp
+++ b/src/gui/dialogs/qwizard_win.cpp
@@ -705,7 +705,6 @@ bool QVistaHelper::resolveSymbols()
{
static bool tried = false;
if (!tried) {
- tried = true;
QSystemLibrary dwmLib(L"dwmapi");
pDwmIsCompositionEnabled =
(PtrDwmIsCompositionEnabled)dwmLib.resolve("DwmIsCompositionEnabled");
@@ -727,6 +726,7 @@ bool QVistaHelper::resolveSymbols()
pDrawThemeTextEx = (PtrDrawThemeTextEx)themeLib.resolve("DrawThemeTextEx");
pSetWindowThemeAttribute = (PtrSetWindowThemeAttribute)themeLib.resolve("SetWindowThemeAttribute");
}
+ tried = true;
}
return (