diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2011-10-07 12:45:40 (GMT) |
---|---|---|
committer | Jan-Arve Saether <jan-arve.saether@nokia.com> | 2011-10-07 12:45:40 (GMT) |
commit | a0feeef52efde872c6d6e458c8e15616da0bf74f (patch) | |
tree | 8c846d041bbce0ac4f10eac1b1b93250144f7f60 /src/gui/styles | |
parent | 74251fb0fc57b1e0f7db0b561e4aa4c0347f6f37 (diff) | |
download | Qt-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/styles')
-rw-r--r-- | src/gui/styles/qwindowsvistastyle.cpp | 2 | ||||
-rw-r--r-- | src/gui/styles/qwindowsxpstyle.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp index b894eb4..f991cbc 100644 --- a/src/gui/styles/qwindowsvistastyle.cpp +++ b/src/gui/styles/qwindowsvistastyle.cpp @@ -2586,7 +2586,6 @@ bool QWindowsVistaStylePrivate::resolveSymbols() { static bool tried = false; if (!tried) { - tried = true; QSystemLibrary themeLib(QLatin1String("uxtheme")); pSetWindowTheme = (PtrSetWindowTheme )themeLib.resolve("SetWindowTheme"); pIsThemePartDefined = (PtrIsThemePartDefined )themeLib.resolve("IsThemePartDefined"); @@ -2611,6 +2610,7 @@ bool QWindowsVistaStylePrivate::resolveSymbols() pGetThemeString = (PtrGetThemeString )themeLib.resolve("GetThemeString"); pGetThemeTransitionDuration = (PtrGetThemeTransitionDuration)themeLib.resolve("GetThemeTransitionDuration"); pGetThemePropertyOrigin = (PtrGetThemePropertyOrigin)themeLib.resolve("GetThemePropertyOrigin"); + tried = true; } return pGetThemeTransitionDuration != 0; } diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp index 3c33df3..dd7f1f6 100644 --- a/src/gui/styles/qwindowsxpstyle.cpp +++ b/src/gui/styles/qwindowsxpstyle.cpp @@ -343,7 +343,6 @@ bool QWindowsXPStylePrivate::resolveSymbols() { static bool tried = false; if (!tried) { - tried = true; QSystemLibrary themeLib(QLatin1String("uxtheme")); pIsAppThemed = (PtrIsAppThemed)themeLib.resolve("IsAppThemed"); if (pIsAppThemed) { @@ -372,6 +371,7 @@ bool QWindowsXPStylePrivate::resolveSymbols() pGetThemeDocumentationProperty = (PtrGetThemeDocumentationProperty )themeLib.resolve("GetThemeDocumentationProperty"); pIsThemeBackgroundPartiallyTransparent = (PtrIsThemeBackgroundPartiallyTransparent)themeLib.resolve("IsThemeBackgroundPartiallyTransparent"); } + tried = true; } return pIsAppThemed != 0; |