summaryrefslogtreecommitdiff
path: root/src/cache.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2010-05-04 17:07:07 +0000
committerMike Buland <eichlan@xagasoft.com>2010-05-04 17:07:07 +0000
commit51c5bfa4881b5def142092e10dd402fd40e2e712 (patch)
tree787ee6a56c14a51e92d8097bce87534ebbae4ec1 /src/cache.h
parent49af4dce0fdc569b623140ca5a711988281835d5 (diff)
downloadlibbu++-51c5bfa4881b5def142092e10dd402fd40e2e712.tar.gz
libbu++-51c5bfa4881b5def142092e10dd402fd40e2e712.tar.bz2
libbu++-51c5bfa4881b5def142092e10dd402fd40e2e712.tar.xz
libbu++-51c5bfa4881b5def142092e10dd402fd40e2e712.zip
Cache fixes?
Diffstat (limited to 'src/cache.h')
-rw-r--r--src/cache.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/cache.h b/src/cache.h
index 896aa71..dc5ab39 100644
--- a/src/cache.h
+++ b/src/cache.h
@@ -318,16 +318,26 @@ namespace Bu
318 printf("Shouldn't erase, references still exist!\n"); 318 printf("Shouldn't erase, references still exist!\n");
319 return; 319 return;
320 } 320 }
321
322 obtype *pObj = hEnt.get( cId ).pData;
323 pCalc->onDestroy( pObj, cId );
324 hEnt.erase( cId );
325
326 pStore->destroy( pObj, cId );
321 } 327 }
322 catch( Bu::HashException &e ) { 328 catch( Bu::HashException &e ) {
323 get( cId ); 329 pCalc->onDestroy( cId );
324 }
325
326 obtype *pObj = hEnt.get( cId ).pData;
327 pCalc->onDestroy( pObj, cId );
328 hEnt.erase( cId );
329 330
330 pStore->destroy( pObj, cId ); 331 if( hEnt.has( cId ) )
332 {
333 // The object was loaded by onDestroy
334 erase( cId );
335 }
336 else
337 {
338 pStore->destroy( cId );
339 }
340 }
331 } 341 }
332 342
333 typedef Bu::List<keytype> KeyList; 343 typedef Bu::List<keytype> KeyList;