for( int i=0; i<messages.size(); i++ ){
Message msg = (Message)messages.get( i );
msg.destroy();
}
}catch( IndexOutOfBoundsException e ){
// as access to messages_last_read isn't synchronized we can get this error if we destroy the
// decoder in parallel with messages being removed. We don't really want to synchornized access
// to this so we'll take the hit here