From 75fcad48c9196c2ce25b9c17d75d9c354fe53cf2 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Wed, 10 Mar 2010 13:29:33 +0000 Subject: [PATCH] Fixed bug #2966885: memory leak caused by strong ref (thanks to tuxx from SF). --- src/security/sasl/defaultSASLAuthenticator.cpp | 4 ++-- vmime/security/sasl/defaultSASLAuthenticator.hpp | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/security/sasl/defaultSASLAuthenticator.cpp b/src/security/sasl/defaultSASLAuthenticator.cpp index 06ffc493..32192f78 100644 --- a/src/security/sasl/defaultSASLAuthenticator.cpp +++ b/src/security/sasl/defaultSASLAuthenticator.cpp @@ -96,7 +96,7 @@ const string defaultSASLAuthenticator::getAnonymousToken() const const string defaultSASLAuthenticator::getServiceName() const { - return m_saslSession->getServiceName(); + return m_saslSession.acquire()->getServiceName(); } @@ -121,7 +121,7 @@ void defaultSASLAuthenticator::setSASLSession(ref sess) ref defaultSASLAuthenticator::getSASLSession() const { - return m_saslSession; + return m_saslSession.acquire(); } diff --git a/vmime/security/sasl/defaultSASLAuthenticator.hpp b/vmime/security/sasl/defaultSASLAuthenticator.hpp index a896b65b..7595de79 100644 --- a/vmime/security/sasl/defaultSASLAuthenticator.hpp +++ b/vmime/security/sasl/defaultSASLAuthenticator.hpp @@ -67,10 +67,8 @@ private: defaultAuthenticator m_default; - weak_ref m_service; - - ref m_saslSession; + weak_ref m_saslSession; ref m_saslMech; };