From e9501b48d86d3c450ac4cbd9b1726d0d22b21784 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Wed, 29 Mar 2006 20:06:39 +0000 Subject: Refactored and cleaned up smart pointers. --- src/security/defaultAuthenticator.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/security/defaultAuthenticator.cpp') diff --git a/src/security/defaultAuthenticator.cpp b/src/security/defaultAuthenticator.cpp index 010d7275..7c3402da 100644 --- a/src/security/defaultAuthenticator.cpp +++ b/src/security/defaultAuthenticator.cpp @@ -44,8 +44,10 @@ defaultAuthenticator::~defaultAuthenticator() const string defaultAuthenticator::getUsername() const { - const string prefix = m_service->getInfos().getPropertyPrefix(); - const propertySet& props = m_service->getSession()->getProperties(); + ref service = m_service.acquire(); + + const string prefix = service->getInfos().getPropertyPrefix(); + const propertySet& props = service->getSession()->getProperties(); if (props.hasProperty(prefix + net::serviceInfos::property::AUTH_USERNAME.getName())) return props[prefix + net::serviceInfos::property::AUTH_USERNAME.getName()]; @@ -56,8 +58,10 @@ const string defaultAuthenticator::getUsername() const const string defaultAuthenticator::getPassword() const { - const string prefix = m_service->getInfos().getPropertyPrefix(); - const propertySet& props = m_service->getSession()->getProperties(); + ref service = m_service.acquire(); + + const string prefix = service->getInfos().getPropertyPrefix(); + const propertySet& props = service->getSession()->getProperties(); if (props.hasProperty(prefix + net::serviceInfos::property::AUTH_PASSWORD.getName())) return props[prefix + net::serviceInfos::property::AUTH_PASSWORD.getName()]; -- cgit v1.2.3