diff options
Diffstat (limited to '')
-rw-r--r-- | src/platforms/posix/posixHandler.cpp | 20 | ||||
-rw-r--r-- | src/platforms/windows/windowsHandler.cpp | 16 |
2 files changed, 14 insertions, 22 deletions
diff --git a/src/platforms/posix/posixHandler.cpp b/src/platforms/posix/posixHandler.cpp index f43972ee..104bc404 100644 --- a/src/platforms/posix/posixHandler.cpp +++ b/src/platforms/posix/posixHandler.cpp @@ -55,18 +55,14 @@ posixHandler::posixHandler() m_socketFactory = vmime::create <posixSocketFactory>(); #endif #if VMIME_HAVE_FILESYSTEM_FEATURES - m_fileSysFactory = new posixFileSystemFactory(); - m_childProcFactory = new posixChildProcessFactory(); + m_fileSysFactory = vmime::create <posixFileSystemFactory>(); + m_childProcFactory = vmime::create <posixChildProcessFactory>(); #endif } posixHandler::~posixHandler() { -#if VMIME_HAVE_FILESYSTEM_FEATURES - delete (m_fileSysFactory); - delete (m_childProcFactory); -#endif } @@ -173,9 +169,9 @@ unsigned int posixHandler::getProcessId() const #if VMIME_HAVE_MESSAGING_FEATURES -ref <vmime::net::socketFactory> posixHandler::getSocketFactory() const +ref <vmime::net::socketFactory> posixHandler::getSocketFactory() { - return m_socketFactory.dynamicCast <vmime::net::socketFactory>(); + return m_socketFactory; } #endif @@ -183,15 +179,15 @@ ref <vmime::net::socketFactory> posixHandler::getSocketFactory() const #if VMIME_HAVE_FILESYSTEM_FEATURES -vmime::utility::fileSystemFactory* posixHandler::getFileSystemFactory() const +ref <vmime::utility::fileSystemFactory> posixHandler::getFileSystemFactory() { - return (m_fileSysFactory); + return m_fileSysFactory; } -vmime::utility::childProcessFactory* posixHandler::getChildProcessFactory() const +ref <vmime::utility::childProcessFactory> posixHandler::getChildProcessFactory() { - return (m_childProcFactory); + return m_childProcFactory; } #endif diff --git a/src/platforms/windows/windowsHandler.cpp b/src/platforms/windows/windowsHandler.cpp index 404d3cbc..1a37c839 100644 --- a/src/platforms/windows/windowsHandler.cpp +++ b/src/platforms/windows/windowsHandler.cpp @@ -49,17 +49,13 @@ windowsHandler::windowsHandler() m_socketFactory = vmime::create <windowsSocketFactory>(); #endif #if VMIME_HAVE_FILESYSTEM_FEATURES - m_fileSysFactory = new windowsFileSystemFactory(); + m_fileSysFactory = vmime::create <windowsFileSystemFactory>(); #endif } windowsHandler::~windowsHandler() { -#if VMIME_HAVE_FILESYSTEM_FEATURES - delete (m_fileSysFactory); -#endif - WSACleanup(); } @@ -240,9 +236,9 @@ unsigned int windowsHandler::getProcessId() const #if VMIME_HAVE_MESSAGING_FEATURES -ref <vmime::net::socketFactory> windowsHandler::getSocketFactory() const +ref <vmime::net::socketFactory> windowsHandler::getSocketFactory() { - return m_socketFactory.dynamicCast <vmime::net::socketFactory>(); + return m_socketFactory; } #endif @@ -250,13 +246,13 @@ ref <vmime::net::socketFactory> windowsHandler::getSocketFactory() const #if VMIME_HAVE_FILESYSTEM_FEATURES -vmime::utility::fileSystemFactory* windowsHandler::getFileSystemFactory() const +ref <vmime::utility::fileSystemFactory> windowsHandler::getFileSystemFactory() { - return (m_fileSysFactory); + return m_fileSysFactory; } -vmime::utility::childProcessFactory* windowsHandler::getChildProcessFactory() const +ref <vmime::utility::childProcessFactory> windowsHandler::getChildProcessFactory() { // TODO: Not implemented return (NULL); |