From 6c066b6bbd4a44ae7c5874abf6bd3a3e04f76b88 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 6 Nov 2024 16:45:09 -0800 Subject: Tests are back, minor fixes. There is a cache tracking bug exposed in cachedel test, it is unclear if this is a regression yet. --- src/stable/myriad.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/stable/myriad.cpp') 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 ) "No such stream exists."); } Stream *pStream = hStream.get( iStream ); - Bu::MutexLocker sl( pStream->mAccess ); - if( pStream->iOpenCount > 0 ) { - throw Bu::MyriadException( Bu::MyriadException::streamOpen, - "Cannot currently erase a stream while it is open."); - } + Bu::MutexLocker sl( pStream->mAccess ); + if( pStream->iOpenCount > 0 ) + { + throw Bu::MyriadException( Bu::MyriadException::streamOpen, + "Cannot currently erase a stream while it is open."); + } - for( Bu::Array::iterator i = pStream->aBlocks.begin(); i; i++ ) - { - releaseBlock( *i, false ); + for( Bu::Array::iterator i = pStream->aBlocks.begin(); i; i++ ) + { + releaseBlock( *i, false ); + } + pStream->aBlocks.clear(); + hStream.erase( iStream ); } - pStream->aBlocks.clear(); - hStream.erase( iStream ); delete pStream; } -- cgit v1.2.3