From 51eef132bb2bb67e658756eaebeae5e52c13de98 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 18 Jul 2013 02:09:29 +0000 Subject: Fixed caching changed issue. The cache now marks objects as unchanged for you after they are saved. It needs some more testing, but the theory is sound. --- src/unstable/cachebase.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/unstable/cachebase.h') diff --git a/src/unstable/cachebase.h b/src/unstable/cachebase.h index 6cc3e77..af2884c 100644 --- a/src/unstable/cachebase.h +++ b/src/unstable/cachebase.h @@ -184,7 +184,8 @@ namespace Bu pEnt( rhs.pEnt ), pData( rhs.pData ) { - pEnt->incRef(); + if( pEnt ) + pEnt->incRef(); } virtual ~CachePtr() @@ -228,7 +229,8 @@ namespace Bu kId = rhs.kId; pEnt = rhs.pEnt; pData = rhs.pData; - pEnt->incRef(); + if( pEnt ) + pEnt->incRef(); return *this; } @@ -513,6 +515,7 @@ namespace Bu Entry *pEnt = hCacheEntry.get( i.getKey() ); Bu::MutexLocker ml( pEnt->getMutex() ); _save( pEnt->getPtr() ); + pEnt->getPtr()->changed( false ); } hChanged.clear(); } -- cgit v1.2.3