mirror of
https://github.com/vale981/tdesktop
synced 2025-03-06 02:01:40 -05:00
Finish working with localstorage before ~AuthSession.
This commit is contained in:
parent
f877bf7a46
commit
dc102bd9e8
3 changed files with 10 additions and 3 deletions
|
@ -228,7 +228,7 @@ bool Instance::isQuitPrevent() {
|
||||||
if (!_currentCall) {
|
if (!_currentCall) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
LOG(("Calls::Instance prevents quit, saving drafts..."));
|
LOG(("Calls::Instance prevents quit, hanging up a call..."));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -103,6 +103,10 @@ Application::~Application() {
|
||||||
_window.reset();
|
_window.reset();
|
||||||
_mediaView.reset();
|
_mediaView.reset();
|
||||||
|
|
||||||
|
// This can call writeMap() that serializes AuthSession.
|
||||||
|
// In case it gets called after authSessionDestroy() we get missing data.
|
||||||
|
Local::finish();
|
||||||
|
|
||||||
// Some MTP requests can be cancelled from data clearing.
|
// Some MTP requests can be cancelled from data clearing.
|
||||||
authSessionDestroy();
|
authSessionDestroy();
|
||||||
|
|
||||||
|
@ -126,7 +130,6 @@ Application::~Application() {
|
||||||
Media::Player::finish(_audio.get());
|
Media::Player::finish(_audio.get());
|
||||||
style::stopManager();
|
style::stopManager();
|
||||||
|
|
||||||
Local::finish();
|
|
||||||
Global::finish();
|
Global::finish();
|
||||||
ThirdParty::finish();
|
ThirdParty::finish();
|
||||||
|
|
||||||
|
|
|
@ -709,6 +709,8 @@ AuthSessionSettings &GetStoredAuthSessionCache() {
|
||||||
void _writeMap(WriteMapWhen when = WriteMapWhen::Soon);
|
void _writeMap(WriteMapWhen when = WriteMapWhen::Soon);
|
||||||
|
|
||||||
void _writeLocations(WriteMapWhen when = WriteMapWhen::Soon) {
|
void _writeLocations(WriteMapWhen when = WriteMapWhen::Soon) {
|
||||||
|
Expects(_manager != nullptr);
|
||||||
|
|
||||||
if (when != WriteMapWhen::Now) {
|
if (when != WriteMapWhen::Now) {
|
||||||
_manager->writeLocations(when == WriteMapWhen::Fast);
|
_manager->writeLocations(when == WriteMapWhen::Fast);
|
||||||
return;
|
return;
|
||||||
|
@ -2398,6 +2400,8 @@ ReadMapState _readMap(const QByteArray &pass) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void _writeMap(WriteMapWhen when) {
|
void _writeMap(WriteMapWhen when) {
|
||||||
|
Expects(_manager != nullptr);
|
||||||
|
|
||||||
if (when != WriteMapWhen::Now) {
|
if (when != WriteMapWhen::Now) {
|
||||||
_manager->writeMap(when == WriteMapWhen::Fast);
|
_manager->writeMap(when == WriteMapWhen::Fast);
|
||||||
return;
|
return;
|
||||||
|
@ -2530,7 +2534,7 @@ void finish() {
|
||||||
_writeMap(WriteMapWhen::Now);
|
_writeMap(WriteMapWhen::Now);
|
||||||
_manager->finish();
|
_manager->finish();
|
||||||
_manager->deleteLater();
|
_manager->deleteLater();
|
||||||
_manager = 0;
|
_manager = nullptr;
|
||||||
delete base::take(_localLoader);
|
delete base::take(_localLoader);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue