Set pointer to client to 0 when client was erased

Signed-off-by: Mariusz Suchora <mariusz.suchora@tieto.com>
This commit is contained in:
Mariusz Suchora
2018-02-23 10:40:06 +01:00
parent b6192d863b
commit ef715ebfa7
2 changed files with 3 additions and 2 deletions

View File

@@ -124,7 +124,7 @@ bool ClientList::authorize(const char* fileName)
return _authorize;
}
void ClientList::erase(Client* client)
void ClientList::erase(Client*& client)
{
if ( !_authorize && client->erasable())
{

View File

@@ -12,6 +12,7 @@
*
* Contributors:
* Tomoaki Yamaguchi - initial API and implementation and/or initial documentation
* Tieto Poland Sp. z o.o. - Gateway improvements
**************************************************************************************/
#ifndef MQTTSNGWCLIENT_H_
@@ -341,7 +342,7 @@ public:
ClientList();
~ClientList();
bool authorize(const char* fileName);
void erase(Client*);
void erase(Client*&);
Client* getClient(SensorNetAddress* addr);
Client* getClient(uint8_t* clientId);
Client* createClient(SensorNetAddress* addr, MQTTSNString* clientId, bool unstableLine,