Index: squid3/src/StoreIOState.cc diff -c squid3/src/StoreIOState.cc:1.3 squid3/src/StoreIOState.cc:1.4 *** squid3/src/StoreIOState.cc:1.3 Fri Feb 21 15:50:06 2003 --- squid3/src/StoreIOState.cc Sun Aug 31 06:44:30 2003 *************** *** 59,64 **** --- 59,66 ---- storeIOState::~storeIOState() { + debugs(20,3, "StoreIOState::~StoreIOState: " << this); + if (read.callback_data) cbdataReferenceDone(read.callback_data); Index: squid3/src/fs/ufs/store_io_ufs.cc diff -c squid3/src/fs/ufs/store_io_ufs.cc:1.22 squid3/src/fs/ufs/store_io_ufs.cc:1.23 *** squid3/src/fs/ufs/store_io_ufs.cc:1.22 Mon Aug 4 16:14:53 2003 --- squid3/src/fs/ufs/store_io_ufs.cc Sun Aug 31 06:44:31 2003 *************** *** 471,479 **** UFSStoreState::doCallback(int errflag) { debug(79, 3) ("storeUfsIOCallback: errflag=%d\n", errflag); - /* We are finished with the file as this is on close or error only.*/ - theFile = NULL; - STIOCB *theCallback = callback; callback = NULL; --- 471,476 ---- *************** *** 481,486 **** --- 478,489 ---- if (cbdataReferenceValidDone(callback_data, &cbdata) && theCallback) theCallback(cbdata, errflag, this); + + /* We are finished with the file as this is on close or error only.*/ + /* This must be the last line, as theFile may be the only object holding + * us in memory + */ + theFile = NULL; } /* ============= THE REAL UFS CODE ================ */