| 190 | } |
| 191 | |
| 192 | AsyncHttpClient::~AsyncHttpClient() |
| 193 | { |
| 194 | /* Unregister first all callbacks before cleaning the |
| 195 | * event queue. |
| 196 | */ |
| 197 | m_tcpClient.onConnect(nullptr); |
| 198 | m_tcpClient.onDisconnect(nullptr); |
| 199 | m_tcpClient.onError(nullptr); |
| 200 | m_tcpClient.onData(nullptr); |
| 201 | m_tcpClient.onTimeout(nullptr); |
| 202 | end(); |
| 203 | |
| 204 | /* Destroy at the end. */ |
| 205 | m_mutex.destroy(); |
| 206 | m_evtQueue.destroy(); |
| 207 | m_cmdQueue.destroy(); |
| 208 | } |
| 209 | |
| 210 | bool AsyncHttpClient::begin(const String& url) |
| 211 | { |