comparison data/fileio/CodedAudioFileReader.cpp @ 1401:cc62d7862203

Some bits and bobs to do with handling memory pressure
author Chris Cannam
date Mon, 06 Mar 2017 17:23:46 +0000
parents 96a6ea30933e
children edee37ae5882
comparison
equal deleted inserted replaced
1400:d2ecf0acc3e2 1401:cc62d7862203
476 } 476 }
477 break; 477 break;
478 478
479 case CacheInMemory: 479 case CacheInMemory:
480 m_dataLock.lock(); 480 m_dataLock.lock();
481 m_data.insert(m_data.end(), buffer, buffer + count); 481 try {
482 m_data.insert(m_data.end(), buffer, buffer + count);
483 } catch (const std::bad_alloc &e) {
484 m_data.clear();
485 m_dataLock.unlock();
486 throw e;
487 }
482 m_dataLock.unlock(); 488 m_dataLock.unlock();
483 break; 489 break;
484 } 490 }
485 } 491 }
486 492