Merge pull request #1262 from ctrlaltca/servatrice_mail

Merge memory leak fix for smtp client
This commit is contained in:
Zach 2015-07-15 12:24:23 -04:00
commit 97acbbfd41

View file

@ -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: