diff options
author | George Hazan <ghazan@miranda.im> | 2019-07-24 14:30:13 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-07-24 14:30:13 +0300 |
commit | 103de9c164934b2393dfcba7011625f90c8a2097 (patch) | |
tree | f7a4a09afe29398f3b7605d7d0db264638a18150 /protocols/Discord | |
parent | 541eab20530165d10592a9fda590f435c6a8b4be (diff) |
NLHR_PTR - smart pointers make better code
Diffstat (limited to 'protocols/Discord')
-rw-r--r-- | protocols/Discord/src/connection.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/protocols/Discord/src/connection.cpp b/protocols/Discord/src/connection.cpp index da7f777d59..1842fe1331 100644 --- a/protocols/Discord/src/connection.cpp +++ b/protocols/Discord/src/connection.cpp @@ -41,15 +41,13 @@ void CDiscordProto::ExecuteRequest(AsyncHttpRequest *pReq) } debugLogA("Executing request #%d:\n%s", pReq->m_iReqNum, pReq->szUrl); - NETLIBHTTPREQUEST *reply = Netlib_HttpTransaction(m_hNetlibUser, pReq); + NLHR_PTR reply(Netlib_HttpTransaction(m_hNetlibUser, pReq)); if (reply != nullptr) { if (pReq->m_pFunc != nullptr) (this->*(pReq->m_pFunc))(reply, pReq); if (pReq->m_bMainSite) m_hAPIConnection = reply->nlc; - - Netlib_FreeHttpRequest(reply); } else { debugLogA("Request %d failed", pReq->m_iReqNum); |