From a2ae51e943d855748962f4738dd9f87b96ad00b0 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Wed, 24 Jun 2015 09:19:27 +0000 Subject: Steam: code cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@14358 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Steam/src/steam_request.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'protocols/Steam/src/steam_request.cpp') diff --git a/protocols/Steam/src/steam_request.cpp b/protocols/Steam/src/steam_request.cpp index 05a7b235b1..c480628151 100644 --- a/protocols/Steam/src/steam_request.cpp +++ b/protocols/Steam/src/steam_request.cpp @@ -35,6 +35,11 @@ static void SteamHttpResponse(const NETLIBHTTPREQUEST *response, void *arg) { SteamResponseDelegate *delegate = (SteamResponseDelegate*)arg; delegate->Invoke(response); +} + +void SteamResponseDelegateFree(void *arg) +{ + SteamResponseDelegate *delegate = (SteamResponseDelegate*)arg; delete delegate; } @@ -46,28 +51,28 @@ void CSteamProto::PushRequest(HttpRequest *request) void CSteamProto::PushRequest(HttpRequest *request, SteamResponseCallback response) { SteamResponseDelegate *delegate = new SteamResponseDelegate(this, response); - requestQueue->Push(request, SteamHttpResponse, delegate); + requestQueue->Push(request, SteamHttpResponse, delegate, SteamResponseDelegateFree); } void CSteamProto::PushRequest(HttpRequest *request, SteamResponseWithArgCallback response, void *arg, HttpFinallyCallback last) { SteamResponseDelegate *delegate = new SteamResponseDelegate(this, response, arg, last); - requestQueue->Push(request, SteamHttpResponse, delegate); + requestQueue->Push(request, SteamHttpResponse, delegate, SteamResponseDelegateFree); } void CSteamProto::SendRequest(HttpRequest *request) { - requestQueue->Send(request, NULL, NULL); + requestQueue->Send(request); } void CSteamProto::SendRequest(HttpRequest *request, SteamResponseCallback response) { SteamResponseDelegate *delegate = new SteamResponseDelegate(this, response); - requestQueue->Send(request, SteamHttpResponse, delegate); + requestQueue->Send(request, SteamHttpResponse, delegate, SteamResponseDelegateFree); } void CSteamProto::SendRequest(HttpRequest *request, SteamResponseWithArgCallback response, void *arg, HttpFinallyCallback last) { SteamResponseDelegate *delegate = new SteamResponseDelegate(this, response, arg, last); - requestQueue->Send(request, SteamHttpResponse, delegate); + requestQueue->Send(request, SteamHttpResponse, delegate, SteamResponseDelegateFree); } -- cgit v1.2.3