From: Alex Rousskov Date: Sun, 12 Sep 2010 00:10:47 +0000 (-0600) Subject: Added debugging to track HttpRequest and AsyncJob memory leaks. X-Git-Tag: take1~271 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5dfc32580de1336030830d5094b9c9e527a4018f;p=thirdparty%2Fsquid.git Added debugging to track HttpRequest and AsyncJob memory leaks. This change is related to Squid bug #2964. Based on lp 3p1-rock branch, r9611 and r9612. --- diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc index 762900b1ca..b383791a6d 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -52,6 +52,8 @@ HttpRequest::HttpRequest() : HttpMsg(hoRequest) HttpRequest::HttpRequest(const HttpRequestMethod& aMethod, protocol_t aProtocol, const char *aUrlpath) : HttpMsg(hoRequest) { + static unsigned int id = 1; + debugs(93,7, HERE << "constructed, this=" << this << " id=" << ++id); init(); initHTTP(aMethod, aProtocol, aUrlpath); } @@ -59,6 +61,7 @@ HttpRequest::HttpRequest(const HttpRequestMethod& aMethod, protocol_t aProtocol, HttpRequest::~HttpRequest() { clean(); + debugs(93,7, HERE << "destructed, this=" << this); } void diff --git a/src/base/AsyncJob.cc b/src/base/AsyncJob.cc index 3fd5557138..215fd842fc 100644 --- a/src/base/AsyncJob.cc +++ b/src/base/AsyncJob.cc @@ -22,12 +22,14 @@ AsyncJob::Pointer AsyncJob::Start(AsyncJob *j) AsyncJob::AsyncJob(const char *aTypeName): typeName(aTypeName), inCall(NULL), id(++TheLastId) { - debugs(93,3, "AsyncJob of type " << typeName << " constructed, this=" << this << - " [async" << id << ']'); + debugs(93,5, "AsyncJob constructed, this=" << this << + " type=" << typeName << " [job" << id << ']'); } AsyncJob::~AsyncJob() { + debugs(93,5, "AsyncJob destructed, this=" << this << + " type=" << typeName << " [job" << id << ']'); } void AsyncJob::start()