AyuGramDesktop/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
..
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 Fix more warnings in submodules. 2021-07-13 21:30:55 +03:00
lib_rlottie@0671bf7054 Initial build with Xcode. 2019-11-25 18:46:02 +03:00
lib_rpl@df721be3fa Improve narrow participants column design. 2021-05-24 22:45:14 +04:00
lib_spellcheck@212d660cbb Fix spellcheck crash on Windows on certain strings. 2021-08-18 15:22:27 +03:00
lib_storage@403df6c4a2 Fix more warnings in submodules. 2021-07-13 21:30:55 +03:00
lib_tl@45faed44e7 Start proper payments processing. 2021-04-06 18:41:15 +04:00
lib_ui@5b521d63a4 Allow QSurfaceFormat::NoProfile in OpenGL detection. 2021-09-09 16:31:51 +03:00
lib_waylandshells@59b0ee55a6 Update submodules. 2021-08-10 16:05:08 +03:00
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
Resources Update API scheme. 2021-09-10 12:58:52 +03:00
SetupFiles initial commit for 0.4.18 version of Telegram Desktop 2014-05-30 12:53:19 +04:00
SourceFiles Close a race between Gio threads and Qt application init. 2021-09-10 13:18:20 +03:00
Telegram Update app icon. 2021-07-20 12:19:56 +03:00
ThirdParty Version 3.0: Update tgcalls submodule. 2021-09-01 01:15:49 +03:00
CMakeLists.txt Start loading users who've read an outgoing message. 2021-09-07 23:41:08 +03:00
configure.bat Fix build scripts. 2020-01-02 13:45:21 +03:00
configure.py Shorten if statement 2021-06-29 10:38:35 +03:00
configure.sh Closed alpha version 1.9.1.8: Fix macOS build. 2019-12-06 14:22:46 +03:00
create.bat Use single LEGAL file with license and copyright. 2018-01-03 13:23:14 +03:00
Telegram.plist Request camera permissions on macOS. 2020-08-11 18:21:40 +04:00