summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobalstatic.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/global/qglobalstatic.h')
-rw-r--r--src/corelib/global/qglobalstatic.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/global/qglobalstatic.h b/src/corelib/global/qglobalstatic.h
index 336512eac3..a6268e057e 100644
--- a/src/corelib/global/qglobalstatic.h
+++ b/src/corelib/global/qglobalstatic.h
@@ -68,7 +68,8 @@ enum GuardValues {
{ \
struct HolderBase { \
~HolderBase() Q_DECL_NOTHROW \
- { guard.store(QtGlobalStatic::Destroyed); } \
+ { if (guard.load() == QtGlobalStatic::Initialized) \
+ guard.store(QtGlobalStatic::Destroyed); } \
}; \
static struct Holder : public HolderBase { \
Type value; \