2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +00:00

Fix contract violation in shutdown with webview.

This commit is contained in:
John Preston
2021-04-13 16:52:40 +04:00
parent e52f947f98
commit 34c5ce16d0
4 changed files with 16 additions and 1 deletions

View File

@@ -63,6 +63,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "storage/storage_domain.h"
#include "storage/storage_databases.h"
#include "storage/localstorage.h"
#include "payments/payments_checkout_process.h"
#include "export/export_manager.h"
#include "window/window_session_controller.h"
#include "window/window_controller.h"
@@ -149,6 +150,15 @@ Application::~Application() {
_window = nullptr;
_mediaView = nullptr;
_notifications->clearAllFast();
// We must manually destroy all windows before going further.
// DestroyWindow on Windows (at least with an active WebView) enters
// event loop and invoke scheduled crl::on_main callbacks.
//
// For example Domain::removeRedundantAccounts() is called from
// Domain::finish() and there is a violation on Ensures(started()).
Payments::CheckoutProcess::ClearAll();
_domain->finish();
Local::finish();