本文整理匯總了C++中Destroy函數的典型用法代碼示例。如果您正苦於以下問題:C++ Destroy函數的具體用法?C++ Destroy怎麽用?C++ Destroy使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Destroy函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: Destroy
int CShrapnelManager::Update (CObject* objP)
{
if ((objP->LifeLeft () <= 0) || !m_data.buffer [objP->Index ()].Update ())
Destroy (objP);
return 0;
}
示例2: assert
void
TopCanvas::Create(PixelSize new_size,
bool full_screen, bool resizable)
{
#ifdef USE_FB
assert(fd < 0);
#ifdef USE_TTY
InitialiseTTY();
#endif
const char *path = "/dev/fb0";
fd = open(path, O_RDWR | O_NOCTTY | O_CLOEXEC);
if (fd < 0) {
fprintf(stderr, "Failed to open %s: %s\n", path, strerror(errno));
return;
}
struct fb_fix_screeninfo finfo;
if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo) < 0) {
fprintf(stderr, "FBIOGET_FSCREENINFO failed: %s\n", strerror(errno));
Destroy();
return;
}
if (finfo.type != FB_TYPE_PACKED_PIXELS) {
fprintf(stderr, "Unsupported console hardware\n");
Destroy();
return;
}
switch (finfo.visual) {
case FB_VISUAL_TRUECOLOR:
case FB_VISUAL_PSEUDOCOLOR:
case FB_VISUAL_STATIC_PSEUDOCOLOR:
case FB_VISUAL_DIRECTCOLOR:
break;
default:
fprintf(stderr, "Unsupported console hardware\n");
Destroy();
return;
}
/* Memory map the device, compensating for buggy PPC mmap() */
const off_t page_size = getpagesize();
off_t offset = off_t(finfo.smem_start)
- (off_t(finfo.smem_start) &~ (page_size - 1));
off_t map_size = finfo.smem_len + offset;
map = mmap(nullptr, map_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
if (map == (void *)-1) {
fprintf(stderr, "Unable to memory map the video hardware: %s\n",
strerror(errno));
map = nullptr;
Destroy();
return;
}
/* Determine the current screen depth */
struct fb_var_screeninfo vinfo;
if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) < 0 ) {
fprintf(stderr, "Couldn't get console pixel format: %s\n",
strerror(errno));
Destroy();
return;
}
#ifdef GREYSCALE
/* switch the frame buffer to 8 bits per pixel greyscale */
vinfo.bits_per_pixel = 8;
vinfo.grayscale = true;
if (ioctl(fd, FBIOPUT_VSCREENINFO, &vinfo) < 0) {
fprintf(stderr, "Couldn't set greyscale pixel format: %s\n",
strerror(errno));
Destroy();
return;
}
/* read new finfo */
ioctl(fd, FBIOGET_FSCREENINFO, &finfo);
map_bpp = 1;
#else
map_bpp = vinfo.bits_per_pixel / 8;
if (map_bpp != 2 && map_bpp != 4) {
fprintf(stderr, "Unsupported console hardware\n");
Destroy();
return;
}
#endif
map_pitch = finfo.line_length;
epd_update_marker = 0;
#ifdef KOBO
ioctl(fd, MXCFB_SET_UPDATE_SCHEME, UPDATE_SCHEME_QUEUE_AND_MERGE);
#endif
//.........這裏部分代碼省略.........
示例3: Destroy
Application::~Application()
{
Destroy ();
}
示例4: Destroy
void AProjectile::TimerExpired()
{
Destroy();
}
示例5: test
void test ()
{
BinarySort * tree = Init(10);
uint64_t* nombresPremiers1 = ( uint64_t* ) malloc( sizeof( uint64_t ) * 64 );
nombresPremiers1[0] = 2;
nombresPremiers1[1] = 3;
nombresPremiers1[2] = 5;
Decomposition *dec1 = (Decomposition*) malloc (sizeof(Decomposition));
dec1 -> value = 30;
dec1 -> tabSize = 3;
dec1 -> primeNumbers = nombresPremiers1;
uint64_t* nombresPremiers2 = ( uint64_t* ) malloc( sizeof( uint64_t ) * 64 );
nombresPremiers2[0] = 2;
nombresPremiers2[1] = 2;
nombresPremiers2[2] = 7;
Decomposition *dec2 = (Decomposition*) malloc (sizeof(Decomposition));
dec2 -> value = 28;
dec2 -> tabSize = 3;
dec2 -> primeNumbers = nombresPremiers2;
uint64_t* nombresPremiers5 = ( uint64_t* ) malloc( sizeof( uint64_t ) * 64 );
nombresPremiers5[0] = 29;
Decomposition *dec5 = (Decomposition*) malloc (sizeof(Decomposition));
dec5 -> value = 29;
dec5 -> tabSize = 1;
dec5 -> primeNumbers = nombresPremiers5;
uint64_t* nombresPremiers3 = ( uint64_t* ) malloc( sizeof( uint64_t ) * 64 );
nombresPremiers3[0] = 3;
nombresPremiers3[1] = 3;
nombresPremiers3[2] = 11;
Decomposition *dec3 = (Decomposition*) malloc (sizeof(Decomposition));
dec3 -> value = 99;
dec3 -> tabSize = 3;
dec3 -> primeNumbers = nombresPremiers3;
uint64_t* nombresPremiers4 = ( uint64_t* ) malloc( sizeof( uint64_t ) * 64 );
nombresPremiers4[0] = 2;
nombresPremiers4[1] = 2;
Decomposition *dec4 = (Decomposition*) malloc (sizeof(Decomposition));
dec4 -> value = 4;
dec4 -> tabSize = 2;
dec4 -> primeNumbers = nombresPremiers4;
InsertValue(tree,dec1);
InsertValue(tree,dec4);
InsertValue(tree,dec2);
InsertValue(tree,dec5);
InsertValue(tree,dec3);
printf("%d\r\n", tree->filled);
int indiceTab=0;
int compteurValeur=0;
int j;
while ( compteurValeur < tree->filled )
{ if (tree->array[indiceTab] != NULL)
{ printf( "indice : " );
printf( "%d\r\n" , indiceTab );
printf( "%ju\r\n" , tree->array[indiceTab]->value);
for ( j = 0 ; j < tree -> array[indiceTab] -> tabSize ; j++ )
{
printf( "%ju\r\n" , tree -> array[indiceTab] -> primeNumbers[j] );
}
compteurValeur++;
}
indiceTab++;
}
Destroy (tree);
}
示例6: Destroy
apoAttrCalcHelper::apoAttrCalcHelper()
{
m_current_parse = 0;
Destroy();
}
示例7: EndModal
void gConfigDialog::OnCancel(wxCommandEvent &event)
{
EndModal(wxID_CANCEL);
Destroy();
}
示例8: Destroy
COptionDialog::~COptionDialog()
{
Destroy();
}
示例9: Destroy
BOOL CNetFile::Download(LPCTSTR pUrl, LPCTSTR pLocal, BOOL bCloseFileAfterDownload, HWND hWndParent)
{_STT();
// Lose previous file
Destroy();
// Downloading
m_bUpload = FALSE;
// Save parent window
m_hWndParent = hWndParent;
// Save close file status
m_bCloseFileAfterDownload = bCloseFileAfterDownload;
// Sanity check
if ( pUrl == NULL || *pUrl == NULL ) return FALSE;
// Are we downloading to file or ram?
m_bMem = ( pLocal == NULL );
{ // Copy the url
char buf[ sizeof( m_szUrl ) ];
DWORD size = sizeof( m_szUrl ) - 1;
// Is it a local file?
if ( GetFileAttributes( pUrl ) == MAXDWORD )
{
// Fix the url
if ( InternetCanonicalizeUrl( pUrl, buf, &size, 0 ) )
{ strcpy_sz( m_szUrl, buf ); }
// Copy the url name
else strcpy_sz( m_szUrl, pUrl );
} // end if
// Copy the local file name
else strcpy_sz( m_szUrl, pUrl );
} // end copy url
// Is it a local file?
if ( GetFileAttributes( m_szUrl ) != MAXDWORD )
{
CWinFile file;
if ( file.OpenExisting( m_szUrl, GENERIC_READ ) )
{
DWORD size = file.Size();
if ( m_bMem )
{
// Allocate memory
m_pMem = new BYTE[ size + 1 ];
if ( m_pMem == NULL )
{ m_dwTransferStatus = NETFILE_DS_ERROR;
return FALSE;
} // end if
// Read in the file
if ( !file.Read( m_pMem, size, &m_dwDataRead ) )
{ m_dwTransferStatus = NETFILE_DS_ERROR;
return FALSE;
} // end if
// NULL terminate for good measure
m_pMem[ size ] = 0;
} // end if
else
{
// Where to download the file
if ( pLocal != DOWNLOADTEMP ) { strcpy_sz( m_szLocal, pLocal ); }
else CWinFile::CreateTemp( m_szLocal );
// Copy the file
CopyFile( m_szUrl, m_szLocal, FALSE );
// Open the file
if ( !m_local.OpenExisting( m_szLocal, GENERIC_READ | GENERIC_WRITE ) )
{ m_dwTransferStatus = NETFILE_DS_ERROR;
return FALSE;
} // end if
// Get the file size
m_dwDataRead = m_local.Size();
} // end else
// Memory read complete
m_dwTransferStatus = NETFILE_DS_DONE;
return TRUE;
} // end if
} // end if
if ( !m_bMem )
//.........這裏部分代碼省略.........
示例10: Net_WriteByte
void DAutosaver::Tick ()
{
Net_WriteByte (DEM_CHECKAUTOSAVE);
Destroy ();
}
示例11: main
//.........這裏部分代碼省略.........
}
/* Parse command line options. */
action = ACTION_RUN;
for(x = 1; x < argc; x++) {
if(!strcmp(argv[x], "-v")) {
DisplayAbout();
DoExit(0);
} else if(!strcmp(argv[x], "-h")) {
DisplayHelp();
DoExit(0);
} else if(!strcmp(argv[x], "-p")) {
action = ACTION_PARSE;
} else if(!strcmp(argv[x], "-restart")) {
action = ACTION_RESTART;
} else if(!strcmp(argv[x], "-exit")) {
action = ACTION_EXIT;
} else if(!strcmp(argv[x], "-reload")) {
action = ACTION_RELOAD;
} else if(!strcmp(argv[x], "-display") && x + 1 < argc) {
displayString = argv[++x];
} else if(!strcmp(argv[x], "-f") && x + 1 < argc) {
Release(configPath);
configPath = CopyString(argv[++x]);
} else {
printf("unrecognized option: %s\n", argv[x]);
DisplayHelp();
DoExit(1);
}
}
switch(action) {
case ACTION_PARSE:
Initialize();
ParseConfig(configPath);
DoExit(0);
case ACTION_RESTART:
SendRestart();
DoExit(0);
case ACTION_EXIT:
SendExit();
DoExit(0);
case ACTION_RELOAD:
SendReload();
DoExit(0);
default:
break;
}
#if defined(HAVE_SETLOCALE) && defined(ENABLE_NLS)
setlocale(LC_ALL, "");
#endif
#ifdef HAVE_GETTEXT
bindtextdomain("jwm", LOCALEDIR);
textdomain("jwm");
#endif
/* The main loop. */
StartupConnection();
do {
isRestarting = shouldRestart;
shouldExit = 0;
shouldRestart = 0;
shouldReload = 0;
/* Prepare JWM components. */
Initialize();
/* Parse the configuration file. */
ParseConfig(configPath);
/* Start up the JWM components. */
Startup();
/* The main event loop. */
EventLoop();
/* Shutdown JWM components. */
Shutdown();
/* Perform any extra cleanup. */
Destroy();
} while(shouldRestart);
ShutdownConnection();
/* If we have a command to execute on shutdown, run it now. */
if(exitCommand) {
execl(SHELL_NAME, SHELL_NAME, "-c", exitCommand, NULL);
Warning(_("exec failed: (%s) %s"), SHELL_NAME, exitCommand);
DoExit(1);
} else {
DoExit(0);
}
/* Control shoud never get here. */
return -1;
}
示例12: Destroy
CMenuItemList::~CMenuItemList()
{ Destroy();
}
示例13: while
//.........這裏部分代碼省略.........
//MAX_EXCEPTION_COUNT exceptions in a row? -> bail out
if (processExceptionCount > MAX_EXCEPTION_COUNT)
{
CLog::Log(LOGERROR, "CApplication::Process(), too many exceptions");
throw;
}
}
catch (...)
{
CLog::Log(LOGERROR, "exception in CApplication::Process()");
processExceptionCount++;
//MAX_EXCEPTION_COUNT exceptions in a row? -> bail out
if (processExceptionCount > MAX_EXCEPTION_COUNT)
{
CLog::Log(LOGERROR, "CApplication::Process(), too many exceptions");
throw;
}
}
#endif
// Frame move the scene
#ifdef XBMC_TRACK_EXCEPTIONS
try
{
#endif
if (!m_bStop) FrameMove(true, m_renderGUI);
//reset exception count
#ifdef XBMC_TRACK_EXCEPTIONS
frameMoveExceptionCount = 0;
}
catch (const XbmcCommons::UncheckedException &e)
{
e.LogThrowMessage("CApplication::FrameMove()");
frameMoveExceptionCount++;
//MAX_EXCEPTION_COUNT exceptions in a row? -> bail out
if (frameMoveExceptionCount > MAX_EXCEPTION_COUNT)
{
CLog::Log(LOGERROR, "CApplication::FrameMove(), too many exceptions");
throw;
}
}
catch (...)
{
CLog::Log(LOGERROR, "exception in CApplication::FrameMove()");
frameMoveExceptionCount++;
//MAX_EXCEPTION_COUNT exceptions in a row? -> bail out
if (frameMoveExceptionCount > MAX_EXCEPTION_COUNT)
{
CLog::Log(LOGERROR, "CApplication::FrameMove(), too many exceptions");
throw;
}
}
#endif
// Render the scene
#ifdef XBMC_TRACK_EXCEPTIONS
try
{
#endif
if (m_renderGUI && !m_bStop) Render();
else if (!m_renderGUI)
{
frameTime = XbmcThreads::SystemClockMillis() - lastFrameTime;
if(frameTime < noRenderFrameTime)
Sleep(noRenderFrameTime - frameTime);
}
#ifdef XBMC_TRACK_EXCEPTIONS
//reset exception count
renderExceptionCount = 0;
}
catch (const XbmcCommons::UncheckedException &e)
{
e.LogThrowMessage("CApplication::Render()");
renderExceptionCount++;
//MAX_EXCEPTION_COUNT exceptions in a row? -> bail out
if (renderExceptionCount > MAX_EXCEPTION_COUNT)
{
CLog::Log(LOGERROR, "CApplication::Render(), too many exceptions");
throw;
}
}
catch (...)
{
CLog::Log(LOGERROR, "exception in CApplication::Render()");
renderExceptionCount++;
//MAX_EXCEPTION_COUNT exceptions in a row? -> bail out
if (renderExceptionCount > MAX_EXCEPTION_COUNT)
{
CLog::Log(LOGERROR, "CApplication::Render(), too many exceptions");
throw;
}
}
#endif
} // while (!m_bStop)
Destroy();
CLog::Log(LOGNOTICE, "application stopped..." );
return m_ExitCode;
}
示例14: Destroy
void JavaString::Reset(const JavaString& str) {
Destroy();
JavaObject::Reset(str);
Init();
}
示例15: Destroy
void Menu::CreatePopUp()
{
Destroy();
mid = new QsciSciPopup();
}