Fix a possible crash caused by a dangling pointer

This commit is contained in:
Daniel Molkentin 2014-06-12 10:29:17 +02:00
parent ed26bcb3e7
commit 4a5ef8f173

View File

@ -42,10 +42,9 @@ void OwncloudShibbolethCredsPage::setupBrowser()
// we need to reset the cookie jar to drop temporary cookies (like the shib cookie)
// i.e. if someone presses "back"
QNetworkAccessManager *qnam = account->networkAccessManager();
delete qnam->cookieJar();
CookieJar *jar = new CookieJar;
// Implicitly deletes the old cookie jar, and reparents the jar
qnam->setCookieJar(jar);
jar->setParent(0);
_browser = new ShibbolethWebView(account);
connect(_browser, SIGNAL(shibbolethCookieReceived(const QNetworkCookie&, Account*)),