aboutsummaryrefslogtreecommitdiff
path: root/src/stable
diff options
context:
space:
mode:
authorMike Buland <mike@xagasoft.com>2024-11-06 16:45:09 -0800
committerMike Buland <mike@xagasoft.com>2024-11-06 16:45:09 -0800
commit6c066b6bbd4a44ae7c5874abf6bd3a3e04f76b88 (patch)
treed6abea40ac9b1a194ab06a52e341b0452918ae40 /src/stable
parent700d4bbcbf59c4447becbab21a6aa7204a8da2f4 (diff)
downloadlibbu++-6c066b6bbd4a44ae7c5874abf6bd3a3e04f76b88.tar.gz
libbu++-6c066b6bbd4a44ae7c5874abf6bd3a3e04f76b88.tar.bz2
libbu++-6c066b6bbd4a44ae7c5874abf6bd3a3e04f76b88.tar.xz
libbu++-6c066b6bbd4a44ae7c5874abf6bd3a3e04f76b88.zip
Tests are back, minor fixes.
There is a cache tracking bug exposed in cachedel test, it is unclear if this is a regression yet.
Diffstat (limited to 'src/stable')
-rw-r--r--src/stable/myriad.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/stable/myriad.cpp b/src/stable/myriad.cpp
index 492676e..53250c2 100644
--- a/src/stable/myriad.cpp
+++ b/src/stable/myriad.cpp
@@ -152,19 +152,21 @@ void Bu::Myriad::erase( Bu::Myriad::StreamId iStream )
152 "No such stream exists."); 152 "No such stream exists.");
153 } 153 }
154 Stream *pStream = hStream.get( iStream ); 154 Stream *pStream = hStream.get( iStream );
155 Bu::MutexLocker sl( pStream->mAccess );
156 if( pStream->iOpenCount > 0 )
157 { 155 {
158 throw Bu::MyriadException( Bu::MyriadException::streamOpen, 156 Bu::MutexLocker sl( pStream->mAccess );
159 "Cannot currently erase a stream while it is open."); 157 if( pStream->iOpenCount > 0 )
160 } 158 {
159 throw Bu::MyriadException( Bu::MyriadException::streamOpen,
160 "Cannot currently erase a stream while it is open.");
161 }
161 162
162 for( Bu::Array<int32_t>::iterator i = pStream->aBlocks.begin(); i; i++ ) 163 for( Bu::Array<int32_t>::iterator i = pStream->aBlocks.begin(); i; i++ )
163 { 164 {
164 releaseBlock( *i, false ); 165 releaseBlock( *i, false );
166 }
167 pStream->aBlocks.clear();
168 hStream.erase( iStream );
165 } 169 }
166 pStream->aBlocks.clear();
167 hStream.erase( iStream );
168 delete pStream; 170 delete pStream;
169} 171}
170 172