aboutsummaryrefslogtreecommitdiffstats
path: root/src/platforms/windows/windowsHandler.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2009-12-08 10:03:34 +0000
committerVincent Richard <[email protected]>2009-12-08 10:03:34 +0000
commita3bf37fb4f758469b7b68ad7dcca170913fcd912 (patch)
tree9004b6aca2e4e749212f959011417d52f21c5cb9 /src/platforms/windows/windowsHandler.cpp
parentInitialize multi-threading for GNUTLS/GCrypt (thanks to Bartek Szurgot). (diff)
downloadvmime-a3bf37fb4f758469b7b68ad7dcca170913fcd912.tar.gz
vmime-a3bf37fb4f758469b7b68ad7dcca170913fcd912.zip
Fixed not exception-safe constructor, which could lead to possible memory leak (thanks to Bartek Szurgot). Get rid of const-ness on factories.
Diffstat (limited to '')
-rw-r--r--src/platforms/windows/windowsHandler.cpp16
1 files changed, 6 insertions, 10 deletions
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);