[Pkg-owncloud-commits] [owncloud-client] 07/219: SSLButton: fix memleak

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Oct 11 14:43:03 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 9b88c7d3c1d11381575febde3d99bfc0909f9483
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Tue Aug 26 14:41:48 2014 +0200

    SSLButton: fix memleak
---
 src/mirall/sslbutton.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/mirall/sslbutton.cpp b/src/mirall/sslbutton.cpp
index e103b36..7afe1ed 100644
--- a/src/mirall/sslbutton.cpp
+++ b/src/mirall/sslbutton.cpp
@@ -176,6 +176,11 @@ void SslButton::updateAccountInfo(Account *account)
     } else {
         setVisible(true);
     }
+    if(QMenu *oldMenu = menu()) {
+        oldMenu->hide(); // Need to be hidden because the QToolButton would be left in invalid state if the menu is deleted while it is visible
+        setMenu(0);
+        oldMenu->deleteLater();  // setMenu do not delete the previous menu.
+    }
     if (account->url().scheme() == QLatin1String("https")) {
         setIcon(QIcon(QPixmap(":/mirall/resources/lock-https.png")));
         QSslCipher cipher = account->sslConfiguration().sessionCipher();
@@ -212,7 +217,6 @@ void SslButton::updateAccountInfo(Account *account)
     } else {
         setIcon(QIcon(QPixmap(":/mirall/resources/lock-http.png")));
         setToolTip(tr("This connection is NOT secure as it is not encrypted.\n"));
-        setMenu(0);
     }
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list