CRWStreambuf::~CRWStreambuf() { try { // Flush only if data pending and no error if (!x_Err || x_ErrPos != x_GetPPos()) x_Sync(); setp(0, 0); } NCBI_CATCH_ALL_X(2, "Exception in ~CRWStreambuf() [IGNORED]"); try { // Push any data still unred in the buffer back to the device ERW_Result result = x_Pushback(); if (result != eRW_Success && result != eRW_NotImplemented) { ERR_POST_X(13, Critical << "CRWStreambuf::~CRWStreambuf():" " Read data pending"); } } NCBI_CATCH_ALL_X(14, "Exception in ~CRWStreambuf() [IGNORED]"); delete[] m_pBuf; }
void CODBCContextRegistry::ClearAll(void) { if (!m_Registry.empty()) { CMutexGuard mg(m_Mutex); while ( !m_Registry.empty() ) { try { // x_Close will unregister and remove handler from the registry. m_Registry.back()->x_Close(false); } NCBI_CATCH_ALL_X(4, "Error closing context"); } }
CRWStreambuf::~CRWStreambuf() { try { // Flush only if data pending and no error if (!x_Err || x_ErrPos != x_GetPPos()) x_sync(); setg(0, 0, 0); setp(0, 0); IReaderWriter* rw = dynamic_cast<IReaderWriter*> (m_Reader); if (rw && rw == dynamic_cast<IReaderWriter*> (m_Writer)) { if ((m_Flags & fOwnAll) == fOwnAll) delete rw; } else { if (m_Flags & fOwnWriter) delete m_Writer; if (m_Flags & fOwnReader) delete m_Reader; } delete[] m_pBuf; } NCBI_CATCH_ALL_X(2, "Exception in ~CRWStreambuf() [IGNORED]"); }