qt5base-lts/tests/auto/corelib/global/qglobalstatic
Thiago Macieira 50d3a2917e Fix Q_GLOBAL_STATIC support for exceptions
The problem was that the HolderBase destructor was getting called after
the contained type's constructor threw an exception, as is required by
RAII semantics (the base was fully initialized, so it had to be
destroyed). That was required because we want to return a non-null
pointer from operator() during destruction and return null after
destruction, to keep compatibility with Qt 4.

The solution is to only set the guard to Destroyed only if it is already
at value Initialized. This way, if the HolderBase destructor is run as
part of the stack unwinding, it knows that the construction did not
complete.

Change-Id: I9849b43ed7112bf9e70861b48a56a924c286617e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-02-28 23:43:46 +01:00
..
qglobalstatic.pro Add a new Q_GLOBAL_STATIC implementation 2013-01-22 17:15:58 +01:00
tst_qglobalstatic.cpp Fix Q_GLOBAL_STATIC support for exceptions 2013-02-28 23:43:46 +01:00