INT32 _pmdController::fini () { if ( _pTcpListener ) { SDB_OSS_DEL _pTcpListener ; _pTcpListener = NULL ; } if ( _pHttpListener ) { SDB_OSS_DEL _pHttpListener ; _pHttpListener = NULL ; } if ( _pMongoListener ) { SDB_OSS_DEL _pMongoListener ; _pMongoListener = NULL ; } if ( _protocol ) { _fapMongo->release( _protocol ) ; } if( _fapMongo ) { _fapMongo->unload() ; SDB_OSS_DEL _fapMongo ; _fapMongo = NULL; } _ctrlLatch.get() ; for ( UINT32 i = 0 ; i < _vecFixBuf.size() ; ++i ) { SDB_OSS_FREE( PMD_FIX_BUFF_TO_PTR( _vecFixBuf[i] ) ) ; } _vecFixBuf.clear() ; _ctrlLatch.release() ; restSessionInfo *pSessionInfo = NULL ; map<string, restSessionInfo*>::iterator it = _mapSessions.begin() ; while( it != _mapSessions.end() ) { pSessionInfo = it->second ; pSessionInfo->releaseMem() ; SDB_OSS_DEL pSessionInfo ; ++it ; } _mapSessions.clear() ; _mapUser2Sessions.clear() ; return SDB_OK ; }
void _pmdController::releaseFixBuf( CHAR * pBuff ) { SDB_ASSERT( pBuff, "Buff can't be NULL" ) ; SDB_ASSERT( PMD_FIX_BUFF_HEADER( pBuff ) == _fixBufSize, "Buff is not alloc by fix buff" ) ; _ctrlLatch.get() ; if ( _vecFixBuf.size() < PMD_FIX_BUFF_CATCH_NUMBER ) { _vecFixBuf.push_back( pBuff ) ; pBuff = NULL ; } _ctrlLatch.release() ; if ( pBuff ) { SDB_OSS_FREE( PMD_FIX_BUFF_TO_PTR( pBuff ) ) ; } }
INT32 _pmdController::fini () { if ( _pTcpListener ) { SDB_OSS_DEL _pTcpListener ; _pTcpListener = NULL ; } if ( _pHttpListener ) { SDB_OSS_DEL _pHttpListener ; _pHttpListener = NULL ; } finishForeignModule() ; // release fix buff catch _ctrlLatch.get() ; for ( UINT32 i = 0 ; i < _vecFixBuf.size() ; ++i ) { SDB_OSS_FREE( PMD_FIX_BUFF_TO_PTR( _vecFixBuf[i] ) ) ; } _vecFixBuf.clear() ; _ctrlLatch.release() ; // release session info restSessionInfo *pSessionInfo = NULL ; map<string, restSessionInfo*>::iterator it = _mapSessions.begin() ; while( it != _mapSessions.end() ) { pSessionInfo = it->second ; pSessionInfo->releaseMem() ; SDB_OSS_DEL pSessionInfo ; ++it ; } _mapSessions.clear() ; _mapUser2Sessions.clear() ; return SDB_OK ; }