diff options
author | Mike Buland <mike@xagasoft.com> | 2024-11-06 16:45:09 -0800 |
---|---|---|
committer | Mike Buland <mike@xagasoft.com> | 2024-11-06 16:45:09 -0800 |
commit | 6c066b6bbd4a44ae7c5874abf6bd3a3e04f76b88 (patch) | |
tree | d6abea40ac9b1a194ab06a52e341b0452918ae40 /src/stable/myriad.cpp | |
parent | 700d4bbcbf59c4447becbab21a6aa7204a8da2f4 (diff) | |
download | libbu++-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/myriad.cpp')
-rw-r--r-- | src/stable/myriad.cpp | 22 |
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 | ||