Correct QGlobalStatic<>::exists() documentation

The documentation claimed that exists() would return true even after
destruction. This was not true when this implementation of QGS was
introduced by commit f7eff7251786186ca895c8fc537b304bc89977b3. The
docs in commit c0860d26a1b87f42842faeda3e6043a775916594, however,
claimed it and no-one seems to have noticed the error until now.
Both commits first landed in Qt 5.1.

Pick-to: 6.5 6.2 5.15
Change-Id: Ic92c8ead25faed0125ff583cb76420a4154af9df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e9226e6e44419affb13ebdd9c624ea8ef357dc2c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Edward Welbourne 2024-10-28 15:04:38 +01:00 committed by Qt Cherry-pick Bot
parent 3614892abe
commit b11f2ccc5b

View File

@ -246,7 +246,7 @@
The QGlobalStatic::exists() and QGlobalStatic::isDestroyed() functions
operate solely on the guard variable: the former returns \c true if the guard
is negative, whereas the latter returns \c true only if it is -2.
is -1, the latter returns \c true if it is -2.
\endomit
@ -359,12 +359,13 @@
This function returns \c true if the global static object has already
completed initialization (that is, if the constructor for the type has
already returned). In specific, note that this function returns \c false if
the initialization is still in progress.
already returned) and has not yet completed destruction. In particular, note
that this function returns \c false if the initialization is still in
progress.
Once this function has returned true once, it will never return false again
until either the program is restarted or the plugin or library containing
the global static is unloaded and reloaded.
until the global static object is destroyed. The latter happens on program
exit or when the plugin or library containing the global static is unloaded.
This function is safe to call at any point in the program execution: it
cannot fail and cannot cause a deadlock. Additionally, it will not cause