From c4dfc634d0425a34b0af40a92a1150be2c5587a3 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 1 Oct 2020 17:45:25 +0300 Subject: [PATCH] Fix crash in main window destruction. --- Telegram/SourceFiles/window/main_window.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Telegram/SourceFiles/window/main_window.cpp b/Telegram/SourceFiles/window/main_window.cpp index 8fe85f3973..fa177a3e08 100644 --- a/Telegram/SourceFiles/window/main_window.cpp +++ b/Telegram/SourceFiles/window/main_window.cpp @@ -705,6 +705,17 @@ void MainWindow::launchDrag(std::unique_ptr data) { MainWindow::~MainWindow() { _title.destroy(); + + // Otherwise: + // ~QWidget + // QWidgetPrivate::close_helper + // QWidgetPrivate::setVisible + // QWidgetPrivate::hide_helper + // QWidgetPrivate::hide_sys + // QWindowPrivate::setVisible + // QMetaObject::activate + // Window::MainWindow::handleVisibleChanged on a destroyed MainWindow. + hide(); } } // namespace Window