diff --git a/Telegram/SourceFiles/mtproto/mtp_instance.cpp b/Telegram/SourceFiles/mtproto/mtp_instance.cpp index 728b85fc4e..c0eed709ca 100644 --- a/Telegram/SourceFiles/mtproto/mtp_instance.cpp +++ b/Telegram/SourceFiles/mtproto/mtp_instance.cpp @@ -229,9 +229,6 @@ private: base::Timer _checkDelayedTimer; - // Debug flag to find out how we end up crashing. - bool MustNotCreateSessions = false; - }; Instance::Private::Private( @@ -273,14 +270,12 @@ void Instance::Private::start(Config &&config) { if (isKeysDestroyer()) { for (auto &dc : _dcenters) { - Assert(!MustNotCreateSessions); auto shiftedDcId = dc.first; auto session = std::make_unique(_instance, shiftedDcId); auto it = _sessions.emplace(shiftedDcId, std::move(session)).first; it->second->start(); } } else if (_mainDcId != Config::kNoneMainDc) { - Assert(!MustNotCreateSessions); auto main = std::make_unique(_instance, _mainDcId); _mainSession = main.get(); _sessions.emplace(_mainDcId, std::move(main)); @@ -581,7 +576,6 @@ void Instance::Private::killSession(ShiftedDcId shiftedDcId) { if (checkIfMainAndKill(shiftedDcId)) { checkIfMainAndKill(_mainDcId); - Assert(!MustNotCreateSessions); auto main = std::make_unique(_instance, _mainDcId); _mainSession = main.get(); _sessions.emplace(_mainDcId, std::move(main)); @@ -715,7 +709,6 @@ void Instance::Private::addKeysForDestroy(AuthKeysList &&keys) { auto dc = std::make_shared(_instance, dcId, std::move(key)); _dcenters.emplace(shiftedDcId, std::move(dc)); - Assert(!MustNotCreateSessions); auto session = std::make_unique(_instance, shiftedDcId); auto it = _sessions.emplace(shiftedDcId, std::move(session)).first; it->second->start(); @@ -1450,7 +1443,6 @@ not_null Instance::Private::getSession( auto it = _sessions.find(shiftedDcId); if (it == _sessions.cend()) { - Assert(!MustNotCreateSessions); it = _sessions.emplace(shiftedDcId, std::make_unique(_instance, shiftedDcId)).first; it->second->start(); } @@ -1576,8 +1568,6 @@ void Instance::Private::prepareToDestroy() { session.second->kill(); } _mainSession = nullptr; - - MustNotCreateSessions = true; } Instance::Instance(not_null options, Mode mode, Config &&config)