这篇教程C++ DESTROY函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DESTROY函数的典型用法代码示例。如果您正苦于以下问题:C++ DESTROY函数的具体用法?C++ DESTROY怎么用?C++ DESTROY使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DESTROY函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: mainint main(int argc, char** argv) { lock_t m[2]; pthread_t alice, bob; if (INIT(m)) { fprintf(stderr, "Failed to create first mutex./n"); return -1; } if (INIT(m + 1)) { fprintf(stderr, "Failed to create second mutex./n"); return -1; } if (pthread_create(&alice, NULL, (void *(*)(void*))alice_main, m)) { fprintf(stderr, "Failed to start alice./n"); return -1; } if (pthread_create(&bob, NULL, (void *(*)(void*))bob_main, m)) { fprintf(stderr, "Failed to start bob./n"); return -1; } pthread_join(alice, NULL); pthread_join(bob, NULL); DESTROY(m); DESTROY(m + 1); return 0;}
开发者ID:Smattr,项目名称:mattutils,代码行数:31,
示例2: RunGamevoid RunGame( int load) { game g = NULL; if(load) { g = LoadGame(); } else { g = NewGame(); } if(g==NULL) { return; } wrefresh(g->arena); wrefresh(g->status); if(g!=NULL) { if(g->pc) g->print(g->pc); creature G = CreateCreature(g); G = g->ZombieListHead; while(G) { g->print(G->Character); G = G->Next; } PrintAllBuildings(g->gameMap, g->pc->pos); PlayLoop(g); if(G) { PurgeCreatureNode(G); DESTROY(G); } PurgeGame(g); DESTROY(g); }}
开发者ID:cryptarch,项目名称:zombies,代码行数:30,
示例3: DESTROYvoid Scene::shRotateAllLights( const Matrix& matrixRotation ){ DESTROY( spRotated ) ; // destroy the old one before making the new one. SHVector* summedLight = sumAllLights() ; // rotate the summed light spRotated = summedLight->rotate( matrixRotation ) ; DESTROY( summedLight ) ; // after i rotate it i only need the rotated result}
开发者ID:sdp0et,项目名称:gtp,代码行数:10,
示例4: configrow_object_freestatic voidconfigrow_object_free (ConfigRow *row){ ASSERT (row != NULL); FREE (row->tag); DESTROY (ConfigPair, row->pair_head); DESTROY (ConfigVector, row->vector_head); FREE (row);}
开发者ID:johnbellone,项目名称:gtkworkbook,代码行数:12,
示例5: crashsim_bdBD_t * crashsim_bd(BD_t * disk, uint32_t threshold){ struct crashsim_info * info; BD_t * bd; info = malloc(sizeof(*info)); if(!info) return NULL; bd = &info->my_bd; info->blocks = hash_map_create(); if(!info->blocks) { free(info); return NULL; } BD_INIT(bd, crashsim_bd); info->bd = disk; info->threshold = threshold; info->crashed = 0; info->absorbed = 0; info->total = 0; bd->blocksize = disk->blocksize; bd->numblocks = disk->numblocks; bd->atomicsize = disk->atomicsize; bd->level = disk->level; bd->graph_index = disk->graph_index + 1; if(bd->graph_index >= NBDINDEX) { DESTROY(bd); return NULL; } if(modman_add_anon_bd(bd, __FUNCTION__)) { DESTROY(bd); return NULL; } if(modman_inc_bd(disk, bd, NULL) < 0) { modman_rem_bd(bd); DESTROY(bd); return NULL; } printf("Crash simulator block device initialized (threshold %u)/n", threshold); return bd;}
开发者ID:pombredanne,项目名称:fstitch,代码行数:50,
示例6: block_resizer_bdBD_t * block_resizer_bd(BD_t * disk, uint16_t blocksize){ struct resize_info * info; uint16_t original_size; BD_t * bd; original_size = disk->blocksize; /* make sure it's an even multiple of the block size */ if(blocksize % original_size) return NULL; /* block resizer not needed */ if(blocksize == original_size) return NULL; info = malloc(sizeof(*info)); if(!info) return NULL; bd = &info->my_bd; BD_INIT(bd, block_resizer_bd); info->bd = disk; info->original_size = original_size; bd->blocksize = blocksize; info->merge_count = blocksize / original_size; bd->atomicsize = disk->atomicsize; bd->numblocks = disk->numblocks / info->merge_count; bd->level = disk->level; bd->graph_index = disk->graph_index + 1; if(bd->graph_index >= NBDINDEX) { DESTROY(bd); return NULL; } if(modman_add_anon_bd(bd, __FUNCTION__)) { DESTROY(bd); return NULL; } if(modman_inc_bd(disk, bd, NULL) < 0) { modman_rem_bd(bd); DESTROY(bd); return NULL; } return bd;}
开发者ID:pombredanne,项目名称:fstitch,代码行数:49,
示例7: mainint main(int argc, char * argv[]){ char input_file[100]; char lookup_file[100]; lpm_root * root = NULL; if(argc != 4) { puts("./alg -v4/6 default_rule input_file"); return 1; } ipv = strcmp("-v6", argv[1]) == 0 ? 6 : 4; sprintf(input_file, "./input/IPv%d/%s", ipv, argv[3]); sprintf(lookup_file, "./input/IPv%d/lookup", ipv); default_rule = atoi(argv[2]); root = INIT(default_rule); fillTable(root, input_file); printf("%lf/n", lookup(root, lookup_file)); DESTROY(root);}
开发者ID:vokracko,项目名称:BP-FastNet,代码行数:25,
示例8: combuf_destroy/* Уничтожение буфера. Функция вызывается только из внутренних задач.*/static void combuf_destroy(const combuf_t combuf){ ASSERT1(CHECK_COMBUF(combuf), "invalid combuf = %u", combuf); /* Пометить буфер для удаления */ DESTROY(combuf); /* Если буфер последний в очереди, то удаляем его и * следующие буферы в очереди ( если они помечены для удаления ) */ if (IS_BACK(combuf)) { cb_store_t _busy; cb_store_t cb_size; do { cb_size = SIZE(back); back = SUM(back, cb_size); __critical_enter(); busy -= cb_size; _busy = busy; __critical_exit(); } while ((0 < _busy) && IS_DESTROYED(back)); }}
开发者ID:MaxGekk,项目名称:ZigZag,代码行数:27,
示例9: DESTROYMethodRegex::~MethodRegex(){ for (std::vector<wxRegEx *>::iterator i = m_regex.begin(); i != m_regex.end(); ++i) { DESTROY(*i); }}
开发者ID:nocturnal,项目名称:FragmentShader,代码行数:7,
示例10: DESTROYMenuState::~MenuState(){ if (m_States != 0) { DESTROY(m_States); }}
开发者ID:nocturnal,项目名称:FragmentShader,代码行数:7,
示例11: DestroyZombiesvoid DestroyZombies( game g ) { if( g == NULL ) return; if( g->ZombieListHead == NULL ) return; while( g->ZombieListHead->Next != NULL ) { creature G = g->ZombieListHead->Next; CutCreatureNode( g->ZombieListHead, G ); if(G != NULL) { PurgeCreatureNode( G ); DESTROY(G); } } if( g->ZombieListHead != NULL ) { PurgeCreatureNode( g->ZombieListHead ); DESTROY( g->ZombieListHead ); }}
开发者ID:cryptarch,项目名称:zombies,代码行数:16,
示例12: DESTROYvoid CBlock::clear() { for (auto iter = blockContents.begin(); iter != blockContents.end();) { DESTROY(iter->second); iter++; } blockContents.clear();}
开发者ID:ideallx,项目名称:serveree,代码行数:7,
示例13: config_method_destroystatic voidconfig_method_destroy (Config * c){ ASSERT (c != NULL); DESTROY (ConfigBlock, c->block_head); config_object_free (c);}
开发者ID:johnbellone,项目名称:gtkworkbook,代码行数:9,
示例14: DESTROYvoid RealFieldValueCache::clear(){ if (find_element_xi_cache) { DESTROY(Computed_field_find_element_xi_cache)(&find_element_xi_cache); find_element_xi_cache = 0; } FieldValueCache::clear();}
开发者ID:A1kmm,项目名称:libzinc,代码行数:9,
示例15: DESTROYAStar::~AStar(){ DESTROY( finalPath ) ; // delete the object, // but no necessarily the Graph * objects // that were passed in, because someone else // may still be using them. // DO NOT DELETE THE 'graph*' object! // It belongs to someone else.}
开发者ID:superwills,项目名称:eternity,代码行数:10,
示例16: DeleteChild void DeleteChild(wxXmlNode& node, const wxString& name) { wxXmlNode *child = FindChild(node, name); if (child != NULL) { node.RemoveChild(child); DESTROY(child); } }
开发者ID:nocturnal,项目名称:FragmentShader,代码行数:10,
示例17: LoadPlayerCharactervoid LoadPlayerCharacter( game g, chr c ) { if( g == NULL || c == NULL ) return; if( g->pc ) { // Start from scratch ... PurgeCharacter( g->pc ); DESTROY(g->pc); } g->pc = CreateCharacter(g); CopyCharacter( g->pc, c ); wrefresh(g->arena);}
开发者ID:cryptarch,项目名称:zombies,代码行数:10,
示例18: configblock_method_destroystatic voidconfigblock_method_destroy (ConfigBlock * block){ ASSERT (block != NULL); DESTROY (ConfigRow, block->row_head); SINGLE_UNLINK (ConfigBlock, block->cfg->block_head, block->cfg->block_tail, block); configblock_object_free (block);}
开发者ID:johnbellone,项目名称:gtkworkbook,代码行数:11,
示例19: vm_destroyvoidvm_destroy(struct vmctx *vm){ assert(vm != NULL); if (vm->fd >= 0) close(vm->fd); DESTROY(vm->name); free(vm);}
开发者ID:amir-partovi,项目名称:Taha,代码行数:11,
示例20: define_Computed_field_type_determinant/***************************************************************************//** * Command modifier function which converts field into type 'determinant' * (if it is not already) and allows its contents to be modified. */int define_Computed_field_type_determinant(struct Parse_state *state, void *field_modify_void, void *computed_field_matrix_operators_package_void){ int return_code; ENTER(define_Computed_field_type_determinant); USE_PARAMETER(computed_field_matrix_operators_package_void); Computed_field_modify_data *field_modify = reinterpret_cast<Computed_field_modify_data*>(field_modify_void); if (state && field_modify) { return_code = 1; cmzn_field_id source_field = 0; if (NULL != field_modify->get_field() && (computed_field_determinant_type_string == Computed_field_get_type_string(field_modify->get_field()))) { source_field = cmzn_field_get_source_field(field_modify->get_field(), 1); } Option_table *option_table = CREATE(Option_table)(); Option_table_add_help(option_table, "Creates a field returning the scalar real determinant of a square matrix. " "Only supports 1, 4 (2x2) and 9 (3x3) component source fields."); struct Set_Computed_field_conditional_data set_source_field_data = { Computed_field_is_square_matrix, /*user_data*/0, field_modify->get_field_manager() }; Option_table_add_entry(option_table, "field", &source_field, &set_source_field_data, set_Computed_field_conditional); return_code = Option_table_multi_parse(option_table, state); if (return_code) { return_code = field_modify->update_field_and_deaccess( cmzn_fieldmodule_create_field_determinant(field_modify->get_field_module(), source_field)); } DESTROY(Option_table)(&option_table); if (source_field) { cmzn_field_destroy(&source_field); } } else { display_message(ERROR_MESSAGE, "define_Computed_field_type_determinant. Invalid argument(s)"); return_code=0; } LEAVE; return (return_code);}
开发者ID:alan-wu,项目名称:cmgui,代码行数:58,
示例21: file_hiding_cfsCFS_t * file_hiding_cfs(CFS_t * frontend_cfs){ file_hiding_state_t * state; CFS_t * cfs; if (!frontend_cfs) return NULL; state = malloc(sizeof(*state)); if (!state) return NULL; cfs = &state->cfs; CFS_INIT(cfs, file_hiding); OBJMAGIC(cfs) = FILE_HIDING_MAGIC; state->hide_table = vector_create(); if (!state->hide_table) goto error_state; state->frontend_cfs = frontend_cfs; state->nopen = 0; if (modman_add_anon_cfs(cfs, __FUNCTION__)) { DESTROY(cfs); return NULL; } if(modman_inc_cfs(frontend_cfs, cfs, NULL) < 0) { modman_rem_cfs(cfs); DESTROY(cfs); return NULL; } return cfs; error_state: free(state); return NULL;}
开发者ID:pombredanne,项目名称:fstitch,代码行数:41,
示例22: DESTROYbool CClientNet::Start(unsigned short port) { if (!CServer::Start(port)) return false; DESTROY(m_agent); m_Connect->addPeer(ServerUID, m_Addr); m_agent = new CPeerConnection(m_Connect->getSocket()); if (!m_agent->isValidSocket()) return false; m_agent->setPeer(m_Addr); return isRunning();}
开发者ID:ideallx,项目名称:serveree,代码行数:13,
示例23: partition_bdBD_t * partition_bd(BD_t * disk, uint32_t start, uint32_t length){ struct partition_info * info; BD_t * bd; info = malloc(sizeof(*info)); if(!info) return NULL; bd = &info->my_bd; BD_INIT(bd, partition_bd); info->bd = disk; info->start = start; bd->blocksize = disk->blocksize; bd->numblocks = length; bd->atomicsize = disk->atomicsize; bd->level = disk->level; bd->graph_index = disk->graph_index + 1; if(bd->graph_index >= NBDINDEX) { DESTROY(bd); return NULL; } if(modman_add_anon_bd(bd, __FUNCTION__)) { DESTROY(bd); return NULL; } if(modman_inc_bd(disk, bd, NULL) < 0) { modman_rem_bd(bd); DESTROY(bd); return NULL; } return bd;}
开发者ID:pombredanne,项目名称:fstitch,代码行数:39,
示例24: tv_widget_textbox_set_textEND_COMPONENT_UPDATEvoid tv_widget_textbox_set_text(tv_widget_textbox *textbox, tvchar *text){ tv_animation* a = ((tv_widget*)textbox)->animation; if(a) { if(((tv_component*)a)->id != tv_animation_id()) { return; } /* delete the old text animation (if there is one) */ DESTROY(a); } tv_widget_set_model((tv_widget*)textbox, tv_gui_model_text(text, 80, textbox->color));}
开发者ID:gummyworm,项目名称:evo,代码行数:14,
注:本文中的DESTROY函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ DESTROYLOCK函数代码示例 C++ DESCRIPTOR_PCAST函数代码示例 |