コード例 #1
0
ファイル: rwstreambuf.cpp プロジェクト: svn2github/ncbi_tk
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;
}
コード例 #2
0
ファイル: context.cpp プロジェクト: swuecho/igblast
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");
        }
    }
コード例 #3
0
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]");
}