Merge pull request #1262 from ctrlaltca/servatrice_mail
Merge memory leak fix for smtp client
This commit is contained in:
commit
97acbbfd41
1 changed files with 8 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue