Go to file
Tor Arne Vestbø ce8e72d040 Android: Defer initialization of logging rules until qApp construction
On Android, we load the application library, and its dependencies (Qt),
on Android's main thread (thread 0), and then spin up a secondary
thread (thread 1), that we call main() on.

If any QObject is constructed during loading of the application library
or any of Qt's libraries, via static initializers or constructor
functions, we will set QCoreApplicationPrivate::theMainThread to
thread 0, which will confuse Qt later on when it's being run on
thread 1, and will result in a warning during QCoreApplication
construction:

 QApplication was not created in the main() thread

This situation can easily lead to a crash as well.

Unfortunately logging via qDebug/qCDebug and friends will trigger
this too, as they internally use QObject.

Fixing the root cause of this is under investigation, but for now
we will partially revert fa2a653b3b for Android. The effect
is that any qCDebug with a "qt.*" category before qApp construction
will turn into a no-op, like it was before fa2a653b3b.

This patch does not cover the case of a regular qDebug, or a qCDebug
with a non-Qt category. Those will still produce the same symptom,
as before fa2a653b3b.

Task-number: QTBUG-65863
Change-Id: I95675731d233244530d0a2a1c82a9578d5599775
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 538b1b5076)
2018-02-07 11:19:44 +00:00
bin don't include injected headers into linker version script 2016-10-14 09:00:29 +00:00
config.tests configure: inline D3D11_QUERY_DATA_TIMESTAMP_DISJOINT test 2018-01-18 13:48:34 +00:00
dist Add bearer plugin removal notice to changelog 2018-01-14 07:45:03 +00:00
doc Doc: Mention exact Qt version the third party attributions apply to 2018-01-19 06:30:06 +00:00
examples examples: Add localserver feature check for localfortune examples 2018-01-27 11:19:06 +00:00
lib Purge all fonts 2015-08-18 19:59:14 +00:00
mkspecs Support for Q_OS_ANDROID_EMBEDDED and android-embedded build flags 2018-01-20 18:16:59 +00:00
qmake Document what the QT qmake variable does in more detail 2018-01-24 11:52:31 +00:00
src Android: Defer initialization of logging rules until qApp construction 2018-02-07 11:19:44 +00:00
tests CoreText: Make sure to keep reference to data when cloning raw font engine 2018-02-07 10:41:12 +00:00
util Fix a bug in the generation of the Unicode joining property data 2017-12-13 19:14:49 +00:00
.gitattributes Update the git-archive export options 2012-09-07 15:39:31 +02:00
.gitignore GitIgnore config.status.bat and config.tests/.qmake.stash 2017-06-13 05:58:30 +00:00
.qmake.conf Bump version 2017-12-13 10:53:55 +00:00
.tag Update the git-archive export options 2012-09-07 15:39:31 +02:00
config_help.txt config_help.txt: document that some sanitize combinations are not valid 2018-01-17 18:09:41 +00:00
configure configure: dispose of which.test 2017-08-02 16:37:32 +00:00
configure.bat configure: Prefer cl.exe over clang-cl.exe 2018-01-04 21:22:42 +00:00
configure.json Disable -optimize-debug for Clang 2017-11-22 03:18:37 +00:00
configure.pri Android: Fix note for host architecture mismatch 2017-11-30 14:39:03 +00:00
header.BSD Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.COMM Add header template for commercial only modules 2015-10-19 10:37:18 +00:00
header.FDL Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.GPL Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.GPL-EXCEPT Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.LGPL Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.LGPL3 Update copyright headers 2015-02-11 06:49:51 +00:00
header.LGPL3-COMM Update copyright headers 2015-02-11 06:49:51 +00:00
header.LGPL-NOGPL2 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.LGPL-ONLY Update copyright headers 2015-02-11 06:49:51 +00:00
INSTALL Doc: Update links in INSTALL file 2015-02-16 09:06:41 +00:00
LGPL_EXCEPTION.txt Update copyright headers 2015-02-11 06:49:51 +00:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.GPL2 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3-EXCEPT Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPLv3 Expand license scope from "Qt GUI Toolkit" to "Qt Toolkit" 2016-06-15 07:02:32 +00:00
LICENSE.LGPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.LGPLv3 Expand license scope from "Qt GUI Toolkit" to "Qt Toolkit" 2016-06-15 07:02:32 +00:00
LICENSE.LGPLv21 Expand license scope from "Qt GUI Toolkit" to "Qt Toolkit" 2016-06-15 07:02:32 +00:00
LICENSE.PREVIEW.COMMERCIAL Add new license header templates and license files 2016-01-14 20:43:46 +00:00
qtbase.pro nuke configure -host-option 2016-12-13 18:55:59 +00:00
sync.profile Merge remote-tracking branch 'origin/5.8' into 5.9 2017-03-13 15:55:44 +01:00