handle cleanup of OAuth web view when force closed

This commit is contained in:
Stephen Birarda 2014-05-01 12:01:08 -07:00
parent 7d3157b1a0
commit ca2148178d
3 changed files with 14 additions and 10 deletions

View file

@ -40,8 +40,11 @@ void OAuthWebViewHandler::addHighFidelityRootCAToSSLConfig() {
void OAuthWebViewHandler::displayWebviewForAuthorizationURL(const QUrl& authorizationURL) {
if (!_activeWebView) {
_activeWebView = new QWebView();
_activeWebView = new QWebView;
// keep the window on top and delete it when it closes
_activeWebView->setWindowFlags(Qt::WindowStaysOnTopHint);
_activeWebView->setAttribute(Qt::WA_DeleteOnClose);
qDebug() << "Displaying QWebView for OAuth authorization at" << authorizationURL.toString();
_activeWebView->load(authorizationURL);

View file

@ -29,7 +29,7 @@ public slots:
private slots:
void handleSSLErrors(QNetworkReply* networkReply, const QList<QSslError>& errorList);
private:
QWebView* _activeWebView;
QPointer<QWebView> _activeWebView;
};
#endif // hifi_OAuthWebviewHandler_h

View file

@ -404,7 +404,6 @@ void NodeList::sendDomainServerCheckIn() {
dtlsSession->writeDatagram(domainServerPacket);
}
const int NUM_DOMAIN_SERVER_CHECKINS_PER_STUN_REQUEST = 5;
static unsigned int numDomainCheckins = 0;
@ -413,14 +412,16 @@ void NodeList::sendDomainServerCheckIn() {
sendSTUNRequest();
}
if (_numNoReplyDomainCheckIns >= MAX_SILENT_DOMAIN_SERVER_CHECK_INS) {
// we haven't heard back from DS in MAX_SILENT_DOMAIN_SERVER_CHECK_INS
// so emit our signal that indicates that
emit limitOfSilentDomainCheckInsReached();
if (_domainHandler.isConnected()) {
if (_numNoReplyDomainCheckIns >= MAX_SILENT_DOMAIN_SERVER_CHECK_INS) {
// we haven't heard back from DS in MAX_SILENT_DOMAIN_SERVER_CHECK_INS
// so emit our signal that indicates that
emit limitOfSilentDomainCheckInsReached();
}
// increment the count of un-replied check-ins
_numNoReplyDomainCheckIns++;
}
// increment the count of un-replied check-ins
_numNoReplyDomainCheckIns++;
}
}