aboutsummaryrefslogtreecommitdiff
path: root/src/unstable/cachebase.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/unstable/cachebase.h')
-rw-r--r--src/unstable/cachebase.h7
1 files changed, 5 insertions, 2 deletions
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
184 pEnt( rhs.pEnt ), 184 pEnt( rhs.pEnt ),
185 pData( rhs.pData ) 185 pData( rhs.pData )
186 { 186 {
187 pEnt->incRef(); 187 if( pEnt )
188 pEnt->incRef();
188 } 189 }
189 190
190 virtual ~CachePtr() 191 virtual ~CachePtr()
@@ -228,7 +229,8 @@ namespace Bu
228 kId = rhs.kId; 229 kId = rhs.kId;
229 pEnt = rhs.pEnt; 230 pEnt = rhs.pEnt;
230 pData = rhs.pData; 231 pData = rhs.pData;
231 pEnt->incRef(); 232 if( pEnt )
233 pEnt->incRef();
232 234
233 return *this; 235 return *this;
234 } 236 }
@@ -513,6 +515,7 @@ namespace Bu
513 Entry *pEnt = hCacheEntry.get( i.getKey() ); 515 Entry *pEnt = hCacheEntry.get( i.getKey() );
514 Bu::MutexLocker ml( pEnt->getMutex() ); 516 Bu::MutexLocker ml( pEnt->getMutex() );
515 _save( pEnt->getPtr() ); 517 _save( pEnt->getPtr() );
518 pEnt->getPtr()->changed( false );
516 } 519 }
517 hChanged.clear(); 520 hChanged.clear();
518 } 521 }