--------------------- PatchSet 6158 Date: 2007/11/20 21:03:43 Author: chtsanti Branch: async-calls Tag: (none) Log: The JobCall class also holds the cbdata pointer of the theJob object, and use this pointer to check if the theJob object is still valid. It was at least stupid to use calls of theJob->toCbdata() to check if the theJob is valid. Members: src/AsyncCall.cc:1.3.22.5->1.3.22.6 src/AsyncCall.h:1.3.22.5->1.3.22.6 Index: squid3/src/AsyncCall.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/AsyncCall.cc,v retrieving revision 1.3.22.5 retrieving revision 1.3.22.6 diff -u -r1.3.22.5 -r1.3.22.6 --- squid3/src/AsyncCall.cc 13 Nov 2007 22:51:06 -0000 1.3.22.5 +++ squid3/src/AsyncCall.cc 20 Nov 2007 21:03:43 -0000 1.3.22.6 @@ -31,12 +31,12 @@ AsyncCallBase(debugSection, debugLevel, callName) { theJob = aJob; - cbdataReference(theJob->toCbdata()); + theCbdata = aJob->toCbdata(); + cbdataReference(theCbdata); } JobCall::~JobCall(){ - void *cbdata=theJob->toCbdata(); - cbdataReferenceDone(cbdata); + cbdataReferenceDone(theCbdata); } @@ -44,7 +44,7 @@ { AsyncJob *theJob = job(); - if(!cbdataReferenceValid(theJob->toCbdata())) + if(!cbdataReferenceValid(theCbdata)) return false; if (!theJob->callStart(theName)) { @@ -70,7 +70,7 @@ debugs(theDebugSection, theDebugLevel, HERE << "job call end"); AsyncJob *theJob = job(); - if(!cbdataReferenceValid(theJob->toCbdata())) + if(!cbdataReferenceValid(theCbdata)) return; theJob->callEnd(); } Index: squid3/src/AsyncCall.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/AsyncCall.h,v retrieving revision 1.3.22.5 retrieving revision 1.3.22.6 diff -u -r1.3.22.5 -r1.3.22.6 --- squid3/src/AsyncCall.h 13 Nov 2007 22:51:06 -0000 1.3.22.5 +++ squid3/src/AsyncCall.h 20 Nov 2007 21:03:43 -0000 1.3.22.6 @@ -1,6 +1,6 @@ /* - * $Id: AsyncCall.h,v 1.3.22.5 2007/11/13 22:51:06 chtsanti Exp $ + * $Id: AsyncCall.h,v 1.3.22.6 2007/11/20 21:03:43 chtsanti Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -224,6 +224,7 @@ virtual void callJob() = 0; AsyncJob *job() {return theJob;} AsyncJob *theJob; + void *theCbdata; }; // This template combines member function pointer calling ability of MemFunT