Commit 97acbbfd authored by Zach's avatar Zach
Browse files

Merge pull request #1262 from ctrlaltca/servatrice_mail

Merge memory leak fix for smtp client
parents 51d12f3e 5dc7c60b
......@@ -25,6 +25,7 @@
/* [1] Constructors and destructors */
SmtpClient::SmtpClient(const QString & host, int port, ConnectionType connectionType) :
socket(NULL),
name("localhost"),
authMethod(AuthPlain),
connectionTimeout(5000),
......@@ -44,7 +45,10 @@ SmtpClient::SmtpClient(const QString & host, int port, ConnectionType connection
this, SLOT(socketReadyRead()));
}
SmtpClient::~SmtpClient() {}
SmtpClient::~SmtpClient() {
if (socket)
delete socket;
}
/* [1] --- */
......@@ -80,6 +84,9 @@ void SmtpClient::setConnectionType(ConnectionType ct)
{
this->connectionType = ct;
if (socket)
delete socket;
switch (connectionType)
{
case TcpConnection:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment