本文整理汇总了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;
}
示例2: SAFEDELETE
void LayoutAttribute::setFont(CFont *font) {
if(m_font && (m_font != m_startFont)) {
m_font->DeleteObject();
SAFEDELETE(m_font);
}
m_font = font;
}
示例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();
}
示例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;
}
示例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;
}
示例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 );
}
示例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);
}
示例8: SAFEDELETE
CMFileUpload::~CMFileUpload()
{
if (m_lstItem)
{
m_lstItem->clear();
}
SAFEDELETE(m_lstItem);
}
示例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();
}
示例10: while
Control::~Control(void)
{
while(mChilds.GetSize())
{
SAFEDELETE(mChilds.Back());
mChilds.EraseBack();
}
}
示例11: DEBUG_ASSERT
RenderWindowOSD::~RenderWindowOSD()
{
DEBUG_ASSERT(Initialized == false);
DEBUG_ASSERT(AttachedLayers.size() == 0);
SAFEDELETE(Pipeline);
AttachedLayers.clear();
}
示例12: SAFEDELETE
void CSystem::ShutDown()
{
if(m_pRenderer)
{
m_pRenderer->Shutdown();
SAFEDELETE(m_pRenderer);
}
if(m_pInput)
{
SAFEDELETE(m_pInput);
}
ShutdownWindows();
return;
}
示例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);
}
示例14: clear
ArrayImpl::~ArrayImpl() {
clear();
SAFEDELETE(m_objectManager);
SAFEDELETEARRAY(m_elem);
#ifdef DEBUG_ARRAYIMPL
descounter++;
#endif
}
示例15: SAFERELEASE
CSimpleFusionBindSink::~CSimpleFusionBindSink()
{
SAFERELEASE(_pBind);
SAFERELEASE(_pdbglog);
if (_hEvent) {
SAFEDELETE(_hEvent);
}
}