Telegram Desktop messaging app
Go to file
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
.github Build dependencies by script on Windows and macOS. 2021-09-07 23:41:54 +03:00
Telegram Close a race between Gio threads and Qt application init. 2021-09-10 13:18:20 +03:00
cmake@e97617c7c5 Display who seen loading state as disabled item. 2021-09-08 14:38:05 +03:00
docs Build dependencies by script on Windows and macOS. 2021-09-07 23:41:54 +03:00
lib/xdg Add tag `launchable` into linux appdata 2020-03-13 11:01:54 +04:00
snap Remove unneeded libraries from snapcraft.yaml 2021-09-07 23:40:08 +03:00
.gitattributes Update lottie icons in voice chats. 2021-04-12 10:48:16 +04:00
.gitignore added CLion-generated files to .gitignore 2021-04-14 08:50:32 +03:00
.gitmodules Version 2.9: Fix build on Linux. 2021-07-30 21:03:49 +03:00
CMakeLists.txt Add loading of custom shipped d3dcompiler_47.dll. 2021-07-20 15:41:49 +03:00
LEGAL Update copyright year to 2021. 2021-01-04 11:24:32 +04:00
LICENSE Add single LEGAL file with license and copyright. 2018-01-03 13:04:34 +03:00
README.md Remove old instructions & patches they referred to 2021-07-20 09:50:57 +03:00
changelog.txt Version 3.0.1. 2021-09-01 19:41:57 +03:00

README.md

Telegram Desktop Official Messenger

This is the complete source code and the build instructions for the alpha version of the official desktop client for the Telegram messenger, based on the Telegram API and the MTProto secure protocol.

Version Build Status Build Status Build Status

Preview of Telegram Desktop

The source code is published under GPLv3 with OpenSSL exception, the license is available here.

Supported systems

The latest version is available for

Old system versions

Version 2.4.4 was the last that supports older systems

Version 1.8.15 was the last that supports older systems

Third-party

Build instructions