diff options
Diffstat (limited to 'src/cache.h')
| -rw-r--r-- | src/cache.h | 24 |
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; |
