-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Expand file tree
/
Copy pathmain.cpp
More file actions
24 lines (20 loc) · 892 Bytes
/
Copy pathmain.cpp
File metadata and controls
24 lines (20 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "core/launcher.h"
extern "C" {
#include <openssl/crypto.h>
} // extern "C"
int main(int argc, char *argv[]) {
// OpenSSL's own atexit handler runs OPENSSL_cleanup() on the main thread
// and frees the library globals while detached background tasks can still
// be inside OpenSSL, so an ordinary quit can fault on a worker thread.
// Suppressing that registration leaves the library state alive until the
// process exits, which is the trade we want: the OS reclaims it anyway.
OPENSSL_init_crypto(OPENSSL_INIT_NO_ATEXIT, nullptr);
const auto launcher = Core::Launcher::Create(argc, argv);
return launcher ? launcher->exec() : 1;
}