From cece4c165f0d19b2fe23cdf367a4e6bba63c4a6e Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 8 Aug 2014 21:18:15 +0000 Subject: The cache didn't handle syncing objects that were marked changed and then deleted before the sync could occur properly. They are now ignored during sync. --- src/unstable/cachebase.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/unstable/cachebase.h b/src/unstable/cachebase.h index b17d377..3db257b 100644 --- a/src/unstable/cachebase.h +++ b/src/unstable/cachebase.h @@ -595,10 +595,24 @@ namespace Bu { for( typename CacheKeySet::iterator i = hChanged.begin(); i; i++ ) { - Entry *pEnt = hCacheEntry.get( i.getKey() ); - Bu::MutexLocker ml( pEnt->getMutex() ); - _save( pEnt->getPtr() ); - pEnt->getPtr()->changed( false ); + Entry *pEnt = NULL; + try + { + pEnt = hCacheEntry.get( i.getKey() ); + } + catch( Bu::HashException ) + { + // The entry wasn't there, most likely because it + // was deleted. That's ok. + } + // This isn't inside of the above because we want to be + // able to handle these exceptions differently. + if( pEnt ) + { + Bu::MutexLocker ml( pEnt->getMutex() ); + _save( pEnt->getPtr() ); + pEnt->getPtr()->changed( false ); + } } hChanged.clear(); } -- cgit v1.2.3