这篇教程C++ HFree函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中HFree函数的典型用法代码示例。如果您正苦于以下问题:C++ HFree函数的具体用法?C++ HFree怎么用?C++ HFree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了HFree函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: TFB_UninitInputvoidTFB_UninitInput (void){ VControl_Uninit (); HFree (controls); HFree (kbdstate);}
开发者ID:ex,项目名称:urquan-masters,代码行数:7,
示例2: _ReleaseCelDataBOOLEAN_ReleaseCelData (void *handle){ DRAWABLE DrawablePtr; int cel_ct; FRAME FramePtr = NULL; if ((DrawablePtr = handle) == 0) return (FALSE); cel_ct = DrawablePtr->MaxIndex + 1; FramePtr = DrawablePtr->Frame; HFree (handle); if (FramePtr) { int i; for (i = 0; i < cel_ct; i++) { TFB_Image *img = FramePtr[i].image; if (img) { FramePtr[i].image = NULL; TFB_DrawScreen_DeleteImage (img); } } HFree (FramePtr); } return (TRUE);}
开发者ID:Serosis,项目名称:UQM-MegaMod,代码行数:31,
示例3: TFB_DrawImage_Deletevoid TFB_DrawImage_Delete (TFB_Image *image){ if (image == 0) { log_add (log_Warning, "INTERNAL ERROR: Tried to delete a null image!"); /* Should we die here? */ return; } LockMutex (image->mutex); TFB_DrawCanvas_Delete (image->NormalImg); if (image->ScaledImg) { TFB_DrawCanvas_Delete (image->ScaledImg); } if (image->Palette) HFree (image->Palette); UnlockMutex (image->mutex); DestroyMutex (image->mutex); HFree (image);}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:25,
示例4: VideoDecoder_FreevoidVideoDecoder_Free (TFB_VideoDecoder *decoder){ if (!decoder) return; decoder->funcs->Close (decoder); decoder->funcs->Term (decoder); HFree (decoder->filename); HFree (decoder);}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:12,
示例5: CreateThread_SDLThreadCreateThread_SDL (ThreadFunction func, void *data, SDWORD stackSize#ifdef NAMED_SYNCHRO , const char *name#endif ){ TrueThread thread; struct ThreadStartInfo *startInfo; thread = (struct _thread *) HMalloc (sizeof *thread);#ifdef NAMED_SYNCHRO thread->name = name;#endif#ifdef PROFILE_THREADS thread->startTime = GetTimeCounter ();#endif thread->localData = CreateThreadLocal (); startInfo = (struct ThreadStartInfo *) HMalloc (sizeof (*startInfo)); startInfo->func = func; startInfo->data = data; startInfo->sem = SDL_CreateSemaphore (0); startInfo->thread = thread; thread->native = SDL_CreateThread (ThreadHelper, (void *) startInfo); if (!(thread->native)) { DestroyThreadLocal (thread->localData); HFree (startInfo); HFree (thread); return NULL; } // The responsibility to free 'startInfo' and 'thread' is now by the new // thread. QueueThread (thread);#ifdef DEBUG_THREADS#if 0 log_add (log_Debug, "Thread '%s' created.", ThreadName (thread)); fflush (stderr);#endif#endif // Signal to the new thread that the thread structure is ready // and it can begin to use it. SDL_SemPost (startInfo->sem); (void) stackSize; /* Satisfying compiler (unused parameter) */ return thread;}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:53,
示例6: DeleteCeosRecordvoid DeleteCeosRecord(CeosRecord_t *record){ if(record) { if(record->Buffer) { HFree(record->Buffer); record->Buffer = NULL; } HFree( record ); }}
开发者ID:0004c,项目名称:node-gdal,代码行数:12,
示例7: destroy_SoundChunk_listvoiddestroy_SoundChunk_list (TFB_SoundChunk *chunk){ TFB_SoundChunk *next = NULL; for ( ; chunk; chunk = next) { next = chunk->next; if (chunk->decoder) SoundDecoder_Free (chunk->decoder); HFree (chunk->text); HFree (chunk); }}
开发者ID:ptaoussanis,项目名称:urquan-masters,代码行数:13,
示例8: ThreadHelperstatic intThreadHelper (void *startInfo) { ThreadFunction func; void *data; SDL_sem *sem; TrueThread thread; int result; func = ((struct ThreadStartInfo *) startInfo)->func; data = ((struct ThreadStartInfo *) startInfo)->data; sem = ((struct ThreadStartInfo *) startInfo)->sem; // Wait until the Thread structure is available. SDL_SemWait (sem); SDL_DestroySemaphore (sem); thread = ((struct ThreadStartInfo *) startInfo)->thread; HFree (startInfo); result = (*func) (data);#ifdef DEBUG_THREADS log_add (log_Debug, "Thread '%s' done (returned %d).", thread->name, result); fflush (stderr);#endif UnQueueThread (thread); DestroyThreadLocal (thread->localData); FinishThread (thread); /* Destroying the thread is the responsibility of ProcessThreadLifecycles() */ return result;}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:32,
示例9: mixSDL_UninitvoidmixSDL_Uninit (void){ int i; UninitStreamDecoder (); for (i = 0; i < NUM_SOUNDSOURCES; ++i) { if (soundSource[i].sample && soundSource[i].sample->decoder) { StopStream (i); } if (soundSource[i].sbuffer) { void *sbuffer = soundSource[i].sbuffer; soundSource[i].sbuffer = NULL; HFree (sbuffer); } DestroyMutex (soundSource[i].stream_mutex); soundSource[i].stream_mutex = 0; mixSDL_DeleteSources (1, &soundSource[i].handle); } SDL_CloseAudio (); mixer_Uninit (); SoundDecoder_Uninit (); SDL_QuitSubSystem (SDL_INIT_AUDIO);}
开发者ID:Serosis,项目名称:UQM-MegaMod,代码行数:30,
示例10: copyError/* * Closes srcHandle if it's not -1. * Closes dstHandle if it's not -1. * Removes unlinkpath from the unlinkHandle dir if it's not NULL. * Frees 'buf' if not NULL. * Always returns -1. * errno is what was before the call. */static intcopyError(uio_Handle *srcHandle, uio_Handle *dstHandle, uio_DirHandle *unlinkHandle, const char *unlinkPath, uint8 *buf){ int savedErrno; savedErrno = errno; log_add (log_Debug, "Error while copying: %s", strerror (errno)); if (srcHandle != NULL) uio_close (srcHandle); if (dstHandle != NULL) uio_close (dstHandle); if (unlinkPath != NULL) uio_unlink (unlinkHandle, unlinkPath); if (buf != NULL) HFree(buf); errno = savedErrno; return -1;}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:33,
示例11: alloc_colormapstatic inline TFB_ColorMap *alloc_colormap (void) // returns an addrefed object{ TFB_ColorMap *map; if (poolhead) { // have some spares map = poolhead; poolhead = map->next; --poolcount; } else { // no spares, need a new one map = HMalloc (sizeof (*map)); map->palette = AllocNativePalette (); if (!map->palette) { HFree (map); return NULL; } } map->next = NULL; map->index = -1; map->refcount = 1; map->version = 0; return map;}
开发者ID:jurchik,项目名称:project6014,代码行数:29,
示例12: ExtractIntstatic void ExtractInt(CeosRecord_t *record, int type, unsigned int offset, unsigned int length, int *value){ void *buffer; char format[32]; buffer = HMalloc( length + 1 ); switch(type) { case __CEOS_REC_TYP_A: sprintf( format, "A%u", length ); GetCeosField( record, offset, format, buffer ); *value = atoi( buffer ); break; case __CEOS_REC_TYP_B: sprintf( format, "B%u", length );#ifdef notdef GetCeosField( record, offset, format, buffer ); if( length <= 4 ) CeosToNative( value, buffer, length, length ); else *value = 0;#else GetCeosField( record, offset, format, value );#endif break; case __CEOS_REC_TYP_I: sprintf( format, "I%u", length ); GetCeosField( record, offset, format, value ); break; } HFree( buffer );}
开发者ID:rashadkm,项目名称:lib_gdal,代码行数:35,
示例13: _ReleaseFontDataBOOLEAN_ReleaseFontData (void *handle){ FONT font = (FONT) handle; if (font == NULL) return FALSE; { FONT_PAGE *page; FONT_PAGE *nextPage; for (page = font->fontPages; page != NULL; page = nextPage) { size_t charI; for (charI = 0; charI < page->numChars; charI++) { TFB_Char *c = &page->charDesc[charI]; if (c->data == NULL) continue; // XXX: fix this if fonts get per-page data // rather than per-char TFB_DrawScreen_DeleteData (c->data); } nextPage = page->next; FreeFontPage (page); } } HFree (font); return TRUE;}
开发者ID:Serosis,项目名称:UQM-MegaMod,代码行数:35,
示例14: GetCodeResDatastatic voidGetCodeResData (const char *ship_id, RESOURCE_DATA *resdata){ BYTE which_res; void *hData; which_res = atoi (ship_id); hData = HMalloc (sizeof (CODERES_STRUCT)); if (hData) { RaceDescInitFunc initFunc = CodeResToInitFunc (which_res); RACE_DESC *RDPtr = (initFunc == NULL) ? NULL : (*initFunc)(); if (RDPtr == 0) { HFree (hData); hData = 0; } else { CODERES_STRUCT *cs; cs = (CODERES_STRUCT *) hData; cs->data = *RDPtr; // Structure assignment. } } resdata->ptr = hData;}
开发者ID:Serosis,项目名称:UQM-MegaMod,代码行数:27,
示例15: openAL_UninitvoidopenAL_Uninit (void){ int i; UninitStreamDecoder (); for (i = 0; i < NUM_SOUNDSOURCES; ++i) { if (soundSource[i].sample && soundSource[i].sample->decoder) { StopStream (i); } if (soundSource[i].sbuffer) { void *sbuffer = soundSource[i].sbuffer; soundSource[i].sbuffer = NULL; HFree (sbuffer); } DestroyMutex (soundSource[i].stream_mutex); } alcMakeContextCurrent (NULL); alcDestroyContext (alcContext); alcContext = NULL; alcCloseDevice (alcDevice); alcDevice = NULL; SoundDecoder_Uninit ();}
开发者ID:SirDifferential,项目名称:Shiver-Balance-Mod,代码行数:30,
示例16: VideoDecoder_LoadTFB_VideoDecoder*VideoDecoder_Load (uio_DirHandle *dir, const char *filename){ const char* pext; TFB_RegVideoDecoder* info; TFB_VideoDecoder* decoder; if (!vd_inited) return NULL; pext = strrchr (filename, '.'); if (!pext) { log_add (log_Warning, "VideoDecoder_Load: Unknown file type"); return NULL; } ++pext; for (info = vd_decoders; info->used && (!info->ext || strcmp (info->ext, pext) != 0); ++info) ; if (!info->ext) { log_add (log_Warning, "VideoDecoder_Load: Unsupported file type"); return NULL; } decoder = (TFB_VideoDecoder*) HCalloc (info->funcs->GetStructSize ()); decoder->funcs = info->funcs; if (!decoder->funcs->Init (decoder, &vd_vidfmt)) { log_add (log_Warning, "VideoDecoder_Load: " "Cannot init '%s' decoder, code %d", decoder->funcs->GetName (), decoder->funcs->GetError (decoder)); HFree (decoder); return NULL; } decoder->dir = dir; decoder->filename = (char *) HMalloc (strlen (filename) + 1); strcpy (decoder->filename, filename); decoder->error = VIDEODECODER_OK; if (!decoder->funcs->Open (decoder, dir, filename)) { log_add (log_Warning, "VideoDecoder_Load: " "'%s' decoder did not load %s, code %d", decoder->funcs->GetName (), filename, decoder->funcs->GetError (decoder)); VideoDecoder_Free (decoder); return NULL; } return decoder;}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:59,
示例17: UninitMeleeLoadStatevoidUninitMeleeLoadState (MELEE_STATE *pMS){ UninitLoadView (pMS); UninitPreBuilt (pMS); if (pMS->load.entryIndices != NULL) HFree (pMS->load.entryIndices);}
开发者ID:jurchik,项目名称:project6014,代码行数:8,
示例18: sdluio_closeintsdluio_close (SDL_RWops *context) { int result; result = uio_fclose ((uio_Stream *) context->hidden.unknown.data1); HFree (context); return result;}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:8,
示例19: key_uninitstatic voidkey_uninit (void){ int i; free_key_pool (pool); for (i = 0; i < num_sdl_keys; i++) bindings[i] = NULL; HFree (bindings); bindings = NULL; pool = NULL;#ifdef HAVE_JOYSTICK for (i = 0; i < joycount; i++) destroy_joystick (i); HFree (joysticks);#endif /* HAVE_JOYSTICK */}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:17,
示例20: destroy_joystickstatic voiddestroy_joystick (int index){ SDL_Joystick *stick = joysticks[index].stick; if (stick) { SDL_JoystickClose (stick); joysticks[index].stick = NULL; HFree (joysticks[index].axes); HFree (joysticks[index].buttons); HFree (joysticks[index].hats); joysticks[index].numaxes = joysticks[index].numbuttons = 0; joysticks[index].axes = NULL; joysticks[index].buttons = NULL; joysticks[index].hats = NULL; }}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:17,
示例21: UninitPreBuiltstatic voidUninitPreBuilt (MELEE_STATE *pMS){ size_t fleetI; for (fleetI = 0; fleetI < pMS->load.preBuiltCount; fleetI++) MeleeTeam_delete (pMS->load.preBuiltList[fleetI]); HFree (pMS->load.preBuiltList); pMS->load.preBuiltCount = 0;}
开发者ID:jurchik,项目名称:project6014,代码行数:9,
示例22: free_key_poolstatic voidfree_key_pool (keypool *x){ if (x) { free_key_pool (x->next); HFree (x); }}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:9,
示例23: _ReleaseSoundBankDataBOOLEAN_ReleaseSoundBankData (void *Snd){ STRING_TABLE fxTab = Snd; if (fxTab) { int snd_ct, index; TFB_SoundSample **sptr; snd_ct = fxTab->size; index = 0; while (snd_ct--) { int i; sptr = (TFB_SoundSample **)(fxTab->strings[index].data); for (i = 0; i < NUM_SOUNDSOURCES; ++i) { if (soundSource[i].sample == (*sptr)) { StopSource (i); soundSource[i].sample = NULL; } } if ((*sptr)->decoder) SoundDecoder_Free ((*sptr)->decoder); audio_DeleteBuffers ((*sptr)->num_buffers, (*sptr)->buffer); HFree ((*sptr)->buffer); if ((*sptr)->buffer_tag) HFree ((*sptr)->buffer_tag); HFree (*sptr); *sptr = 0; index++; } FreeStringTable (Snd); return (TRUE); } return (FALSE);}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:44,
示例24: FreeRecipesvoid FreeRecipes( void ){ Link_t *link; for( link = RecipeFunctions; link != NULL; link = link->next ) HFree( link->object ); DestroyList( RecipeFunctions ); RecipeFunctions = NULL;}
开发者ID:rashadkm,项目名称:lib_gdal,代码行数:11,
示例25: cdp_Host_UnregisterEventstatic voidcdp_Host_UnregisterEvent (cdp_EventReg* evtreg){ if (evtreg < cdp_evts || evtreg >= cdp_evts + MAX_REG_EVENTS || !evtreg->name) { fprintf (stderr, "cdp_Host_UnregisterEvent(): " "Invalid or expired event passed/n"); return; } if (!evtreg->builtin) { HFree (evtreg->name); } evtreg->module = NULL; evtreg->name = NULL; if (evtreg->binds) HFree (evtreg->binds); evtreg->binds = NULL; evtreg->bindslots = 0;}
开发者ID:jurchik,项目名称:project6014,代码行数:22,
示例26: LoadTeamListvoidLoadTeamList (MELEE_STATE *pMS){ COUNT i; DestroyDirEntryTable (ReleaseDirEntryTable (pMS->load.dirEntries)); pMS->load.dirEntries = CaptureDirEntryTable ( LoadDirEntryTable (meleeDir, "", ".mle", match_MATCH_SUFFIX)); if (pMS->load.entryIndices != NULL) HFree (pMS->load.entryIndices); pMS->load.numIndices = GetDirEntryTableCount (pMS->load.dirEntries); pMS->load.entryIndices = HMalloc (pMS->load.numIndices * sizeof pMS->load.entryIndices[0]); for (i = 0; i < pMS->load.numIndices; i++) pMS->load.entryIndices[i] = i;}
开发者ID:jurchik,项目名称:project6014,代码行数:17,
示例27: UninitColorMapsvoidUninitColorMaps (void){ TFB_ColorMap *next; // free spares for ( ; poolhead; poolhead = next) { next = poolhead->next; HFree (poolhead); } // uninit xform control DestroyMutex (XFormControl.Lock); // uninit colormaps DestroyMutex (maplock);}
开发者ID:jurchik,项目名称:project6014,代码行数:18,
示例28: set_strtab_entrystatic voidset_strtab_entry (STRING_TABLE_DESC *strtab, int index, const char *value, int len){ STRING str = &strtab->strings[index]; if (str->data) { HFree (str->data); str->data = NULL; str->length = 0; } if (len) { str->data = HMalloc (len); str->length = len; memcpy (str->data, value, len); }}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:18,
注:本文中的HFree函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ HGOTO_ERROR函数代码示例 C++ HFS_SB函数代码示例 |