From 09d9e114398e826a4e676c4dbb3cbe7f88d1236c Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Tue, 4 Oct 2005 18:34:25 +0000 Subject: Added service::setSocketFactory(). --- src/platforms/posix/posixHandler.cpp | 10 +++------- src/platforms/windows/windowsHandler.cpp | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) (limited to 'src/platforms') diff --git a/src/platforms/posix/posixHandler.cpp b/src/platforms/posix/posixHandler.cpp index ef7e55cc..8703d4c0 100644 --- a/src/platforms/posix/posixHandler.cpp +++ b/src/platforms/posix/posixHandler.cpp @@ -48,7 +48,7 @@ namespace posix { posixHandler::posixHandler() { #if VMIME_HAVE_MESSAGING_FEATURES - m_socketFactory = new posixSocketFactory(); + m_socketFactory = vmime::create (); #endif #if VMIME_HAVE_FILESYSTEM_FEATURES m_fileSysFactory = new posixFileSystemFactory(); @@ -59,9 +59,6 @@ posixHandler::posixHandler() posixHandler::~posixHandler() { -#if VMIME_HAVE_MESSAGING_FEATURES - delete (m_socketFactory); -#endif #if VMIME_HAVE_FILESYSTEM_FEATURES delete (m_fileSysFactory); delete (m_childProcFactory); @@ -172,10 +169,9 @@ const unsigned int posixHandler::getProcessId() const #if VMIME_HAVE_MESSAGING_FEATURES -vmime::net::socketFactory* posixHandler::getSocketFactory - (const vmime::string& /* name */) const +ref posixHandler::getSocketFactory() const { - return (m_socketFactory); + return m_socketFactory.dynamicCast (); } diff --git a/src/platforms/windows/windowsHandler.cpp b/src/platforms/windows/windowsHandler.cpp index d67b9d5a..4f5a94b5 100644 --- a/src/platforms/windows/windowsHandler.cpp +++ b/src/platforms/windows/windowsHandler.cpp @@ -42,7 +42,7 @@ namespace windows { windowsHandler::windowsHandler() { #if VMIME_HAVE_MESSAGING_FEATURES - m_socketFactory = new windowsSocketFactory(); + m_socketFactory = vmime::create (); #endif #if VMIME_HAVE_FILESYSTEM_FEATURES m_fileSysFactory = new windowsFileSystemFactory(); @@ -52,9 +52,6 @@ windowsHandler::windowsHandler() windowsHandler::~windowsHandler() { -#if VMIME_HAVE_MESSAGING_FEATURES - delete (m_socketFactory); -#endif #if VMIME_HAVE_FILESYSTEM_FEATURES delete (m_fileSysFactory); #endif @@ -237,10 +234,9 @@ const unsigned int windowsHandler::getProcessId() const #if VMIME_HAVE_MESSAGING_FEATURES -vmime::net::socketFactory* windowsHandler::getSocketFactory - (const vmime::string& /* name */) const +ref windowsHandler::getSocketFactory() const { - return (m_socketFactory); + return m_socketFactory.dynamicCast (); } -- cgit