mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Merge memory leak fix for smtp client
source:
c12f70b721
fd4feb5c0f17ddef93d5a56
This commit is contained in:
parent
51d12f3ed6
commit
056edd8570
1 changed files with 9 additions and 2 deletions
|
|
@ -29,7 +29,8 @@ SmtpClient::SmtpClient(const QString & host, int port, ConnectionType connection
|
|||
authMethod(AuthPlain),
|
||||
connectionTimeout(5000),
|
||||
responseTimeout(5000),
|
||||
sendMessageTimeout(60000)
|
||||
sendMessageTimeout(60000),
|
||||
socket(NULL)
|
||||
{
|
||||
setConnectionType(connectionType);
|
||||
|
||||
|
|
@ -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…
Add table
Add a link
Reference in a new issue