]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup: convert helper allocation from cbdataAlloc to new
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 27 Nov 2013 00:37:24 +0000 (13:37 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 27 Nov 2013 00:37:24 +0000 (13:37 +1300)
The helper_server and helper_stateful_server classes are already
CBDATA_CLASS2 defined classes with new/delete operators and the free
operation already handled by delete(). However teh allocation was not
using new() and thus not calling the class constructors properly.

src/helper.cc

index 55c47208676c92f92d988088d3d20fe337b98637..8e8ed002f06e3c893e8f16d5a21e5a0d0e97619f 100644 (file)
@@ -81,9 +81,9 @@ static void StatefulEnqueue(statefulhelper * hlp, helper_stateful_request * r);
 static bool helperStartStats(StoreEntry *sentry, void *hlp, const char *label);
 
 CBDATA_CLASS_INIT(helper);
-CBDATA_TYPE(helper_server);
+CBDATA_CLASS_INIT(helper_server);
 CBDATA_CLASS_INIT(statefulhelper);
-CBDATA_TYPE(helper_stateful_server);
+CBDATA_CLASS_INIT(helper_stateful_server);
 
 void
 HelperServerBase::initStats()
@@ -223,8 +223,7 @@ helperOpenServers(helper * hlp)
 
         ++ hlp->childs.n_running;
         ++ hlp->childs.n_active;
-        CBDATA_INIT_TYPE(helper_server);
-        srv = cbdataAlloc(helper_server);
+        srv = new helper_server;
         srv->hIpc = hIpc;
         srv->pid = pid;
         srv->initStats();
@@ -344,8 +343,7 @@ helperStatefulOpenServers(statefulhelper * hlp)
 
         ++ hlp->childs.n_running;
         ++ hlp->childs.n_active;
-        CBDATA_INIT_TYPE(helper_stateful_server);
-        helper_stateful_server *srv = cbdataAlloc(helper_stateful_server);
+        helper_stateful_server *srv = new helper_stateful_server;
         srv->hIpc = hIpc;
         srv->pid = pid;
         srv->flags.reserved = false;