Have a global Core::Launcher accessor

This allows to use Launcher in code executing before Sandbox is created
This commit is contained in:
Ilya Fedin
2023-06-13 04:34:27 +04:00
committed by John Preston
parent 63ccf1bed4
commit a7bd097b2f
13 changed files with 50 additions and 70 deletions

View File

@@ -24,8 +24,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Platform {
namespace {
Launcher *LauncherInstance = nullptr;
class Arguments {
public:
void push(QByteArray argument) {
@@ -50,15 +48,6 @@ private:
Launcher::Launcher(int argc, char *argv[])
: Core::Launcher(argc, argv)
, _arguments(argv, argv + argc) {
Expects(LauncherInstance == nullptr);
LauncherInstance = this;
}
Launcher &Launcher::Instance() {
Expects(LauncherInstance != nullptr);
return *LauncherInstance;
}
int Launcher::exec() {