tdesktop/Telegram
Gleb Smirnoff 720f238cf8 Close a race between Gio threads and Qt application init.
QApplication has a historical feature[1] of calling setlocale(3) at init,
which today cause more harm than good.  Such call isn't thread safe neither
per C standard, not per any known libc implementation.  The Gio threads
would call into locale reading functions all the time, so early access to
locale by Gio may race with setlocale() by Qt leading to undefined behavior.

Platform specific start before the Sandbox (aka QApplication) is at core
design of tdesktop and that order can't be changed. There is no way to pause
Gio until QApplication instantiates.

Fortunately, Qt library itself has a static global flag that prevents it
from calling setlocale() twice. We don't even need to instantiate a
temporary QCoreApplication, we can just call into the method.  So call
it form Platform::start before any existing or future calls to Gio.

Fixes #16922

[1] https://chat.stackoverflow.com/rooms/63812/discussion-between-phil-armstrong-and-matteo-italia
2021-09-10 13:18:20 +03:00
..
Resources Update API scheme. 2021-09-10 12:58:52 +03:00
SetupFiles
SourceFiles Close a race between Gio threads and Qt application init. 2021-09-10 13:18:20 +03:00
Telegram
ThirdParty Version 3.0: Update tgcalls submodule. 2021-09-01 01:15:49 +03:00
build Update patches revision. 2021-09-08 00:10:36 +03:00
cmake Start loading users who've read an outgoing message. 2021-09-07 23:41:08 +03:00
codegen@b1c206550e Custom colors in historyDown/unreadMentions buttons. 2021-09-06 13:13:26 +03:00
lib_base@4ccf5d6c8c Replace GTK integration with xsettings + XDP 2021-09-06 15:43:28 +03:00
lib_crl@ec103d6bcc Disable fp exceptions in Windows 32 bit build. 2021-08-24 20:32:26 +03:00
lib_lottie@25294ef8da Couple of crash fixes. 2021-09-01 13:27:36 +03:00
lib_qr@2b08c71c6e
lib_rlottie@0671bf7054
lib_rpl@df721be3fa
lib_spellcheck@212d660cbb
lib_storage@403df6c4a2
lib_tl@45faed44e7
lib_ui@5b521d63a4 Allow QSurfaceFormat::NoProfile in OpenGL detection. 2021-09-09 16:31:51 +03:00
lib_waylandshells@59b0ee55a6
lib_webrtc@29d5131791 Support mono playback in OpenAL ADM. 2021-08-30 20:32:57 +03:00
lib_webview@3cb51ac668 Beta version 2.9.13: Update lib_webview. 2021-08-31 11:13:48 +03:00
CMakeLists.txt Start loading users who've read an outgoing message. 2021-09-07 23:41:08 +03:00
Telegram.plist
configure.bat
configure.py
configure.sh
create.bat