当前位置: 首页>>代码示例>>C++>>正文


C++ SAFEDELETE函数代码示例

本文整理汇总了C++中SAFEDELETE函数的典型用法代码示例。如果您正苦于以下问题:C++ SAFEDELETE函数的具体用法?C++ SAFEDELETE怎么用?C++ SAFEDELETE使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SAFEDELETE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CMSession

BOOL CMQuestionUpload::AnswerQuestion(const char* sQuestionID, int nAnonymous, const char* sAnswer,const char* filename)
{
    
    if(!m_pSession)
		m_pSession = new CMSession(this);
	if(m_pSession->IsRunning())
		return FALSE;
    
	char param[640];
	snprintf(param,sizeof(param),"&questionid=%s&anonymous=%d", sQuestionID, nAnonymous);
    //构造form数据
    CMList<FormData>* list= new CMList<FormData>;
	//加入文本内容
    FormData data;

    if(filename!=NULL&&strlen(filename)!=0)
    {
        data.key=CMString("pic");
        data.value=CMString(filename);
        data.dataType=2;
        list->push_back(data);
    }

    data.key=CMString("content");
    data.value=CMString(sAnswer);
    data.dataType=1;
    list->push_back(data);

    m_pSession->CommandPost(SERVICE_ANSWERQUESTION, param,*list);
    SAFEDELETE(list);
    
    return TRUE;
}
开发者ID:jianbinking,项目名称:mlplayer_midea,代码行数:33,代码来源:cmquestionupload.cpp

示例2: SAFEDELETE

void LayoutAttribute::setFont(CFont *font) {
  if(m_font && (m_font != m_startFont)) {
    m_font->DeleteObject();
    SAFEDELETE(m_font);
  }
  m_font = font;
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:7,代码来源:LayoutAttribute.cpp

示例3: SAFEDELETE

void AnimatedImage::clearDisposeTable() {
  for(size_t i = 0; i < m_disposeTable.size(); i++) {
    PixRect *pr = m_disposeTable[i];
    SAFEDELETE(pr);
  }
  m_disposeTable.clear();
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:7,代码来源:AnimatedImage.cpp

示例4: while

//=============================================================================
int XSocket::_iSendUnsentData()
{
    int iRet;
    char * pTemp;

    while (m_pUnsentDataList[m_sHead] != NULL) {

        iRet = _iSend_ForInternalUse(m_pUnsentDataList[m_sHead], m_iUnsentDataSize[m_sHead]);

        if (iRet == m_iUnsentDataSize[m_sHead]) {
            SAFEDELETE(m_pUnsentDataList[m_sHead]);
            m_iUnsentDataSize[m_sHead] = 0;
            m_sHead++;
            if (m_sHead >= m_iBlockLimit) m_sHead = 0;
        }
        else {
            if (iRet < 0)
                return iRet;

            pTemp = new char[m_iUnsentDataSize[m_sHead] - iRet];
            memcpy(pTemp, m_pUnsentDataList[m_sHead] + iRet, m_iUnsentDataSize[m_sHead] - iRet);

            delete m_pUnsentDataList[m_sHead];
            m_pUnsentDataList[m_sHead] = pTemp;

            return XSOCKEVENT_UNSENTDATASENDBLOCK;
        }
    }

    return XSOCKEVENT_UNSENTDATASENDCOMPLETE;
}
开发者ID:X4N1,项目名称:Helbreath-International-Source,代码行数:32,代码来源:XSocket.cpp

示例5: NEW

HRESULT CHistoryInfoNode::Create(AsmBindHistoryInfo *pHistInfo, CHistoryInfoNode **pphn)
{
    HRESULT                                     hr = S_OK;
    CHistoryInfoNode                               *pHList = NULL;
   
    if (!pHistInfo || !pphn) {
        hr = E_INVALIDARG;
        goto Exit;
    }

    *pphn = NULL;

    pHList = NEW(CHistoryInfoNode);
    if (!pHList) {
        hr = E_OUTOFMEMORY;
        goto Exit;
    }

    hr = pHList->Init(pHistInfo);
    if (FAILED(hr)) {
        SAFEDELETE(pHList);
        goto Exit;
    }

    *pphn = pHList;

Exit:
    return hr;
}
开发者ID:ArildF,项目名称:masters,代码行数:29,代码来源:histnode.cpp

示例6: PIN_Open

EXTERN_C
DWORD
PIN_Open(
    DWORD Context, 
    DWORD Access,
    DWORD ShareMode
    )
{
    DEBUGMSG( ZONE_FUNCTION, ( _T("PIN_Open(%x, 0x%x, 0x%x)\r\n"), Context, Access, ShareMode ) );

    UNREFERENCED_PARAMETER( ShareMode );
    UNREFERENCED_PARAMETER( Access );
   
    PPININITHANDLE pPinInit = reinterpret_cast<PPININITHANDLE>( Context );

    ASSERT( NULL != pPinInit );
    PPINDEVICE pPinDevice = new PINDEVICE;

    if ( NULL == pPinDevice )
    {
        DEBUGMSG( ZONE_FUNCTION, ( _T("PIN_Open(%x): Not enough memory to create pin device\r\n"), Context ) );
    }
    else
    {
        if ( false == pPinDevice->InitializeSubDevice( pPinInit->pCamDevice ) )
        {
            SAFEDELETE( pPinDevice );
            DEBUGMSG( ZONE_INIT|ZONE_ERROR, ( _T("PIN_Init: Initialization Failed") ) );
        }

    }

    return reinterpret_cast<DWORD>( pPinDevice );
}
开发者ID:blueskycoco,项目名称:dm3730-spi,代码行数:34,代码来源:pindriver.cpp

示例7: SAFEDELETE

SunLight::~SunLight(void)
{
	//SAFEDESTROY(m_pGameModel);
	CGameModelManager::GetInstance()->ReleaseDisplayModel(m_pGameModel);
	CGameModelManager::GetInstance()->ReleaseGameModel(m_pGameModel->GetGameModelID());
	m_pGameModel = NULL;
	SAFEDELETE(m_pAnimInfo);
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:8,代码来源:Light.cpp

示例8: SAFEDELETE

CMFileUpload::~CMFileUpload()
{
    if (m_lstItem)
    {
        m_lstItem->clear();
    }
    SAFEDELETE(m_lstItem);
}
开发者ID:jianbinking,项目名称:mlplayer_midea,代码行数:8,代码来源:cmupload.cpp

示例9: SAFEDELETE

Mesh::~Mesh(){
	for (Surfaces::iterator surface = surfaces.begin(); surface != surfaces.end(); surface++){
		surface->pShader = NULL;
		surface->pTexture = NULL;
		SAFEDELETE(surface->pSurface);
	}
	surfaces.clear();
}
开发者ID:q4r,项目名称:QEngine,代码行数:8,代码来源:Mesh.cpp

示例10: while

Control::~Control(void)
{
	while(mChilds.GetSize())
	{
		SAFEDELETE(mChilds.Back());
		mChilds.EraseBack();
	}
}
开发者ID:m1h4,项目名称:AudioAnalyzer,代码行数:8,代码来源:Control.cpp

示例11: DEBUG_ASSERT

		RenderWindowOSD::~RenderWindowOSD()
		{
			DEBUG_ASSERT(Initialized == false);
			DEBUG_ASSERT(AttachedLayers.size() == 0);

			SAFEDELETE(Pipeline);
			AttachedLayers.clear();
		}
开发者ID:shadeMe,项目名称:Construction-Set-Extender,代码行数:8,代码来源:RenderWindowOSD.cpp

示例12: SAFEDELETE

void CSystem::ShutDown()
{
	if(m_pRenderer)
	{
		m_pRenderer->Shutdown();
		SAFEDELETE(m_pRenderer);
	}

	if(m_pInput)
	{
		SAFEDELETE(m_pInput);
	}

	ShutdownWindows();

	return;
}
开发者ID:akatzman13,项目名称:Space-Rail-Shooter,代码行数:17,代码来源:System.cpp

示例13: CRect

void GifFrame::cleanup() {
  m_disposeTo        = NULL;
  m_owner            = NULL;
  m_disposalMode     = DISPOSAL_UNSPECIFIED;
  m_delayTime        = 0;
  m_useTransparency  = false;
  m_srcRect = m_rect = CRect(0,0,0,0);
  SAFEDELETE(m_pr);
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:9,代码来源:AnimatedImage.cpp

示例14: clear

ArrayImpl::~ArrayImpl() {
  clear();
  SAFEDELETE(m_objectManager);
  SAFEDELETEARRAY(m_elem);

#ifdef DEBUG_ARRAYIMPL
  descounter++;
#endif
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:9,代码来源:ArrayImpl.cpp

示例15: SAFERELEASE

CSimpleFusionBindSink::~CSimpleFusionBindSink()
{
    SAFERELEASE(_pBind);
    SAFERELEASE(_pdbglog);

    if (_hEvent) {
        SAFEDELETE(_hEvent);
    }
}
开发者ID:Anupam-,项目名称:shared-source-cli-2.0,代码行数:9,代码来源:simplesink.cpp


注:本文中的SAFEDELETE函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。