本文整理汇总了C++中safeDelete函数的典型用法代码示例。如果您正苦于以下问题:C++ safeDelete函数的具体用法?C++ safeDelete怎么用?C++ safeDelete使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了safeDelete函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: releaseAll
//=============================================================================
// Delete all reserved memory
//=============================================================================
void Game::deleteAll()
{
releaseAll(); // call onLostDevice() for every graphics item
safeDelete(graphics);
safeDelete(input);
initialized = false;
}
开发者ID:parkmk2,项目名称:test,代码行数:10,代码来源:game.cpp
示例2: stopMusic
bool AudioHandler::setMusic(const std::string& musicKey)
{
//Set current music playing.
stopMusic();
if(musicList.find(musicKey) == musicList.end())
{
std::cout << "Music not found";
return true;
}
if(song != NULL) safeDelete(song);
song = new sbe::Music();
if(!song->OpenFromFile(musicList[musicKey]))
{
Logger::writeMsg(1) << "Music could not be loaded!";
safeDelete(song);
return true;
}
song->SetVolume(mVol);
song->Initialize(2, 44100);
song->Play();
Logger::writeMsg(1) << "Music \"" << musicKey << "\" now playing.";
return false;
}
开发者ID:Liag,项目名称:shmup-base-engine,代码行数:26,代码来源:audiohandler.cpp
示例3: safeDelete
Lab3Canvas::~Lab3Canvas()
{
safeDelete(m_timer);
safeDelete(m_camera);
gluDeleteQuadric(m_quadric);
makeCurrent();
}
开发者ID:pauljnixon,项目名称:Graphics,代码行数:7,代码来源:Lab03.cpp
示例4: safeDelete
Kernel::~Kernel()
{
program->removeAllShaders();
safeDelete(fragmentShader);
safeDelete(vertexShader);
safeDelete(program);
}
开发者ID:ola-ct,项目名称:directorsview,代码行数:7,代码来源:kernel.cpp
示例5: assert
void CSystem::destroyContexts()
{
assert( G_RENDERCTX );
safeDelete( G_RENDERCTX );
assert( G_INPUTCTX );
safeDelete( G_INPUTCTX );
}
开发者ID:BackupTheBerlios,项目名称:dingus-svn,代码行数:8,代码来源:System.cpp
示例6: WinMain
//=============================================================================
// Starting point for a Windows application
//=============================================================================
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
// Check for memory leak if debug build
#if defined(DEBUG) | defined(_DEBUG)
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif
MSG msg;
// Create the game, sets up message handler
game = new TileCollision;
// Create the window
if (!CreateMainWindow(hwnd, hInstance, nCmdShow))
return 1;
try{
game->initialize(hwnd); // throws GameError
// main message loop
int done = 0;
while (!done)
{
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
// look for quit message
if (msg.message == WM_QUIT)
done = 1;
// decode and pass messages on to WinProc
TranslateMessage(&msg);
DispatchMessage(&msg);
} else
game->run(hwnd); // run the game loop
}
safeDelete(game); // free memory before exit
return msg.wParam;
}
catch(const GameError &err)
{
game->deleteAll();
DestroyWindow(hwnd);
MessageBox(NULL, err.getMessage(), "Error", MB_OK);
}
catch(...)
{
game->deleteAll();
DestroyWindow(hwnd);
MessageBox(NULL, "Unknown error occured in game.", "Error", MB_OK);
}
safeDelete(game); // free memory before exit
return 0;
}
开发者ID:codebachi,项目名称:ProjectDX_Kelly,代码行数:58,代码来源:winmain.cpp
示例7: delete
LyingShapesScene::~LyingShapesScene()
{
for (auto shapeIt = cubes.begin(); shapeIt != cubes.end(); shapeIt++)
{
delete (*shapeIt);
}
cubes.clear();
safeDelete(&grid);
safeDelete(&coords);
safeDelete(&mCubes);
}
开发者ID:bikush,项目名称:simple-sph-simulation,代码行数:12,代码来源:LyingShapesScene.cpp
示例8: safeDelete
void cCore::finalize()
{
safeDelete(m_gui);
safeDelete(m_renderer, true);
safeDelete(m_luaMgr);
safeDelete(m_classCreater);
safeDelete(m_msgMgr);
safeDelete(m_batchRenderMgr, true);
safeDelete(m_postProcessMgr, true);
safeDelete(m_fileSystem, true);
safeDelete(m_fileWatcher);
safeDelete(m_debugRenderMgr, true);
}
开发者ID:prodongi,项目名称:Bread,代码行数:13,代码来源:BreadCore.cpp
示例9: safeDelete
void FlowText::close()
{
if (mRunning)
{
gGlobalClient->getTimerAxis()->KillTimer(0, this);
mText.clear_wstr();
safeDelete(mPosX);
safeDelete(mPosY);
safeDelete(mAlpha);
safeDelete(mSize);
mRunning = false;
}
}
开发者ID:lorichen,项目名称:xgame,代码行数:14,代码来源:FlowText.cpp
示例10: safeDelete
CWall3D::~CWall3D()
{
for( int i = 0; i < RMCOUNT; ++i ) {
safeDelete( mRenderables[i] );
}
safeDelete( mFadeInMesh );
stl_utils::wipe( mPiecesCombined );
safeDeleteArray( mPieces3D );
safeDeleteArray( mFracturedPieces );
safeDeleteArray( mPieceRestoreTimes );
safeDeleteArray( mQuadtree );
safeDeleteArray( mResTimeGrid );
}
开发者ID:BackupTheBerlios,项目名称:dingus-svn,代码行数:15,代码来源:WallPieces.cpp
示例11: assert
void AsynFileDevice::Close()
{
if ( m_hHandle!=INVALID_HANDLE_VALUE )
{
::CloseHandle(m_hHandle);
m_hHandle = INVALID_HANDLE_VALUE;
}
assert(m_pendingList.empty());
m_pendingList.clear();
safeDelete(m_pReader);
safeDelete(m_pWriter);
}
开发者ID:lorichen,项目名称:xgame,代码行数:15,代码来源:AsynFileDevice.cpp
示例12: gWriteD3DSettingsPref
void CDemo::shutdown()
{
gWriteD3DSettingsPref();
CONS << "Shutting down..." << endl;
CGameInfo::finalize();
delete gDebugRenderer;
safeDelete( gUIDlg );
safeDelete( gUISettingsDlg );
safeDelete( gUIHelpDlg );
safeDelete( gUIGameSetupDlg );
CONS << "Done!" << endl;
}
开发者ID:BackupTheBerlios,项目名称:dingus-svn,代码行数:15,代码来源:Demo.cpp
示例13: memset
bool MemoryFileWriter::reallocate(size_t s)
{
if (s == 0)
{
return false;
}
size_t newSize = _cursor + s;
void* b = new char[newSize];
if (b == NULL)
{
return false;
}
memset(b, 0, newSize);
if (_cursor > 0)
{
memcpy(b, _buffer, _cursor);
}
safeDelete(_buffer);
_buffer = b;
_length = newSize;
return true;
}
开发者ID:cpzhang,项目名称:bud,代码行数:27,代码来源:DataChunk.cpp
示例14: safeDelete
void AudioHandler::fadeOut(float elapsed, const std::string& strM, float s)
{
//Fade out music during s seconds, or crossfade between song and strM if c = true.
if(fadeCounter != 0) return;
if(strM != "") cross = true;
fadeCounter = elapsed;
interval = mVol / s;
if(cross)
{
if(musicList.find(strM) == musicList.end())
std::cout << "Music not found";
crossSong = new sbe::Music();
if(!crossSong->OpenFromFile(musicList[strM]))
{
Logger::writeMsg(1) << "Music could not be loaded!";
safeDelete(crossSong);
}
crossSong->SetVolume(0);
crossSong->Initialize(2, 44100);
crossSong->Play();
Logger::writeMsg(1) << "Music \"" << strM << "\" now playing.";
}
}
开发者ID:Liag,项目名称:shmup-base-engine,代码行数:25,代码来源:audiohandler.cpp
示例15: glDeleteVertexArrays
Tessellator::~Tessellator()
{
glDeleteVertexArrays(1, &m_vaoID);
glDeleteBuffers(1, &m_bufferID);
glDeleteQueries(1, &m_primitivesQuery);
safeDelete(program);
}
开发者ID:ArtisticCoding,项目名称:hair,代码行数:7,代码来源:tessellator.cpp
示例16: safeDelete
void SyncSourceConfig::setEncoding(const char* s) {
safeDelete(&encodings);
if (s) {
encodings = stringdup(s);
}
}
开发者ID:fieldwind,项目名称:syncsdk,代码行数:7,代码来源:SyncSourceConfig.cpp
示例17: safeDelete
bool CButtonNode::setLogicEntity(logic::CButton* logicButton){
// Si no asociamos ninguna entidad logica, terminamos con exito
if(!CUINode::setLogicEntity(logicButton))
return false;
// Si ya hemos asociado una representacion logica,
// borramos la antigua
if(_logicButton){
_logicButton->removeListener(this);
safeDelete(_logicButton);
}
// Nos añadimos como observador y si fallamos devolvemos false
if(!logicButton->addListener(this))
return false;
// Asociamos la entidad logica
_logicButton = logicButton;
// Asignamos al boton los atributos
_status = (COglButton::EButtonStatus)logicButton->status();
textChanged(logicButton->text(), _logicButton->fontName(), _logicButton->fontSize());
return true;
}
开发者ID:DamnCoder,项目名称:YAOMEV,代码行数:26,代码来源:ButtonNode.cpp
示例18: FinishSqliteVFS
void PackageService::onFinish()
{
FinishSqliteVFS();
// Turn off all sticky flags - NO MERCY!
for (PackageNameMap::iterator itr = _linkedPackages.begin(), end = _linkedPackages.end(); itr != end; ++itr)
{
itr->second->_stayResident = false;
itr->second->_stayForCurrent = false;
itr->second->_stayForNext = false;
}
// And compact so that all packages get disposed
compact();
// If Something's remaining, we're in danger!
for (PackageNameMap::iterator itr = _linkedPackages.begin(), end = _linkedPackages.end(); itr != end; ++itr)
{
Package* pack = itr->second;
LOG(0, "*** Package '%s': still alive: %d usage, requires:\n", pack->getName().c_str(), pack->getUseCount());
if (pack->getRequiredList().empty())
LOG(0, " <none>\n");
else
pack->printDependancy(1);
}
// Terminate AsyncLoader
if (_asyncLoader)
{
_asyncLoader->Terminate();
}
safeDelete(_asyncLoader);
}
开发者ID:noriter,项目名称:nit,代码行数:34,代码来源:PackageService.cpp
示例19: safeRelease
TxGuiRenderer::~TxGuiRenderer()
{
safeRelease(m_pVB);
safeRelease(m_pVBQuick);
safeDelete(m_pResourceProvider);
m_alphaMaskImages.clear();
}
开发者ID:lorichen,项目名称:xgame,代码行数:7,代码来源:TxGuiReRenderer.cpp
示例20: FOREACH
FiberMesh::~FiberMesh() {
m_dragData.isDragging = false;
FOREACH(CurveListIter, m_curves, iter) {
DifferentialCurve *curve = *iter;
safeDelete(curve);
}
开发者ID:fisch0920,项目名称:Milton,代码行数:8,代码来源:FiberMesh.cpp
注:本文中的safeDelete函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论