diff --git a/src/app/mainapplication.cpp b/src/app/mainapplication.cpp index 985b36b00..efa658dc0 100644 --- a/src/app/mainapplication.cpp +++ b/src/app/mainapplication.cpp @@ -683,7 +683,8 @@ static const int sessionVersion = 0x0002; bool MainApplication::saveStateSlot() { - if (m_websettings->testAttribute(QWebSettings::PrivateBrowsingEnabled) || m_isRestoring) { + if (m_websettings->testAttribute(QWebSettings::PrivateBrowsingEnabled) || + m_isRestoring || m_mainWindows.count() == 0) { return false; } @@ -697,6 +698,7 @@ bool MainApplication::saveStateSlot() stream << sessionVersion; stream << m_mainWindows.count(); + for (int i = 0; i < m_mainWindows.count(); i++) { QupZilla* qz = m_mainWindows.at(i).data(); if (!qz) { diff --git a/src/app/qupzilla.cpp b/src/app/qupzilla.cpp index 3b504b951..d7d10add4 100644 --- a/src/app/qupzilla.cpp +++ b/src/app/qupzilla.cpp @@ -1479,7 +1479,14 @@ void QupZilla::closeEvent(QCloseEvent* event) #ifndef Q_WS_MAC if (mApp->windowCount() == 0) { - quitApp() ? event->accept() : event->ignore(); + if (quitApp()) { + event->accept(); + disconnectAllWidgets(); + } + else { + event->ignore(); + } + return; } #endif @@ -1537,7 +1544,7 @@ bool QupZilla::quitApp() } } - mApp->quitApplication(); + QTimer::singleShot(0, mApp, SLOT(quitApplication())); return true; } diff --git a/src/network/networkmanager.cpp b/src/network/networkmanager.cpp index c593d5b98..a38509f07 100644 --- a/src/network/networkmanager.cpp +++ b/src/network/networkmanager.cpp @@ -106,7 +106,7 @@ void NetworkManager::loadSettings() void NetworkManager::setSSLConfiguration(QNetworkReply* reply) { - if (!reply->sslConfiguration().isNull() && !mApp->isClosing()) { + if (!reply->sslConfiguration().isNull()) { QSslCertificate cert = reply->sslConfiguration().peerCertificate(); if (!cert.isValid() || reply->property("downReply").toBool()) { return; diff --git a/src/webview/webview.cpp b/src/webview/webview.cpp index ce31a3f5b..6253efe30 100644 --- a/src/webview/webview.cpp +++ b/src/webview/webview.cpp @@ -222,10 +222,6 @@ void WebView::loadFinished(bool state) { Q_UNUSED(state); - if (mApp->isClosing() || p_QupZilla->isClosing()) { - return; - } - if (animationLoading(tabIndex(), false)->movie()) { animationLoading(tabIndex(), false)->movie()->stop(); } @@ -324,11 +320,6 @@ void WebView::titleChanged() void WebView::iconChanged() { - if (mApp->isClosing() || p_QupZilla->isClosing()) { - return; - } - -// if (isCurrent()) emit siteIconChanged(); if (m_isLoading) {