mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-05 09:39:22 -08:00
Merge pull request #1262 from ctrlaltca/servatrice_mail
Merge memory leak fix for smtp client
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user