当前位置: 首页>>代码示例>>C++>>正文


C++ DestroyInstance函数代码示例

本文整理汇总了C++中DestroyInstance函数的典型用法代码示例。如果您正苦于以下问题:C++ DestroyInstance函数的具体用法?C++ DestroyInstance怎么用?C++ DestroyInstance使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DestroyInstance函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: set

// static
XPCNativeSet*
XPCNativeSet::GetNewOrUsed(XPCCallContext& ccx, const nsIID* iid)
{
    AutoMarkingNativeSetPtr set(ccx);

    AutoMarkingNativeInterfacePtr iface(ccx);
    iface = XPCNativeInterface::GetNewOrUsed(ccx, iid);
    if(!iface)
        return nsnull;

    XPCNativeSetKey key(nsnull, iface, 0);

    XPCJSRuntime* rt = ccx.GetRuntime();
    NativeSetMap* map = rt->GetNativeSetMap();
    if(!map)
        return nsnull;

    {   // scoped lock
        XPCAutoLock lock(rt->GetMapLock());
        set = map->Find(&key);
    }

    if(set)
        return set;

    // hacky way to get a XPCNativeInterface** using the AutoPtr
    XPCNativeInterface* temp[] = {iface}; 
    set = NewInstance(ccx, temp, 1);
    if(!set)
        return nsnull;

    {   // scoped lock
        XPCAutoLock lock(rt->GetMapLock());
        XPCNativeSet* set2 = map->Add(&key, set);
        if(!set2)
        {
            NS_ERROR("failed to add our set!");
            DestroyInstance(set);
            set = nsnull;
        }
        else if(set2 != set)
        {
            DestroyInstance(set);
            set = set2;
        }
    }

    return set;
}
开发者ID:jdahlin,项目名称:jslint,代码行数:50,代码来源:xpcwrappednativeinfo.cpp

示例2: EmptyTrash

void EmptyTrash(void)
{
  register unsigned c;
  register unsigned long i,len;
  register struct DumpRec *p,*next;
  register struct gl_list_t *l;
  if (g_dump_inst_count==0) return;
  for(c=0;c<DUMPHASHSIZE;c++) {
    p = g_dump_ht[c];
    g_dump_ht[c]=NULL;
    while (p!=NULL) {
      AssertAllocatedMemory(p,sizeof(struct DumpRec));
      next = p->next;
      if ((l=p->instances)!=NULL) {
	len = gl_length(l);
	for(i=1;i<=len;i++)
	  DestroyInstance((struct Instance *)gl_fetch(l,i),NULL);
	gl_destroy(l);
      }
      ascfree((char *)p);
      p = next;
    }
  }
  g_dump_type_count = 0;
  g_dump_inst_count = 0;
}
开发者ID:georgyberdyshev,项目名称:ascend,代码行数:26,代码来源:dump.c

示例3: while

void MapInstanced::Update(const uint32 t)
{
    // take care of loaded GridMaps (when unused, unload it!)
    Map::Update(t);

    // update the instanced maps
    InstancedMaps::iterator i = m_InstancedMaps.begin();

    while (i != m_InstancedMaps.end())
    {
        if (i->second->CanUnload(t))
        {
            if (!DestroyInstance(i))                             // iterator incremented
            {
                //m_unloadTimer
            }
        }
        else
        {
            // update only here, because it may schedule some bad things before delete
            if (sMapMgr->GetMapUpdater()->activated())
                sMapMgr->GetMapUpdater()->schedule_update(*i->second, t);
            else
                i->second->Update(t);
            ++i;
        }
    }
}
开发者ID:Blackn7g,项目名称:Voodoo,代码行数:28,代码来源:MapInstanced.cpp

示例4: iface

// static
XPCNativeInterface*
XPCNativeInterface::GetNewOrUsed(XPCCallContext& ccx, const nsIID* iid)
{
    AutoMarkingNativeInterfacePtr iface(ccx);
    XPCJSRuntime* rt = ccx.GetRuntime();

    IID2NativeInterfaceMap* map = rt->GetIID2NativeInterfaceMap();
    if(!map)
        return nsnull;

    {   // scoped lock
        XPCAutoLock lock(rt->GetMapLock());
        iface = map->Find(*iid);
    }

    if(iface)
        return iface;

    nsCOMPtr<nsIInterfaceInfo> info;
    ccx.GetXPConnect()->GetInfoForIID(iid, getter_AddRefs(info));
    if(!info)
        return nsnull;

    iface = NewInstance(ccx, info);
    if(!iface)
        return nsnull;

    {   // scoped lock
        XPCAutoLock lock(rt->GetMapLock());
        XPCNativeInterface* iface2 = map->Add(iface);
        if(!iface2)
        {
            NS_ERROR("failed to add our interface!");
            DestroyInstance(ccx, rt, iface);
            iface = nsnull;
        }
        else if(iface2 != iface)
        {
            DestroyInstance(ccx, rt, iface);
            iface = iface2;
        }
    }

    return iface;
}
开发者ID:jdahlin,项目名称:jslint,代码行数:46,代码来源:xpcwrappednativeinfo.cpp

示例5: DestroyInstance

void CEventManager::Terminate()
{
	m_bIsInit = false;

	//if (m_Thread.joinable())
	//	m_Thread.join();

	DestroyInstance();
};
开发者ID:Void13,项目名称:AnubisEngine,代码行数:9,代码来源:EventManager.cpp

示例6: GetInstance

/*
========
Engine::RunScene

	Initializes the engine, and runs the scene passed in.
========
*/
int Engine::RunScene( Scene* scene ) {
	Engine* inst = GetInstance();
	inst->SetScene(scene);
	
	int retValue = inst->MainLoop();
	
	GetInstance()->Shutdown();
	DestroyInstance();
	 
	return retValue;
}
开发者ID:Mertank,项目名称:ToneArm,代码行数:18,代码来源:Engine.cpp

示例7: GetInstance

//====================================
//	Creates the DInputDeviceDB object
//====================================
FUSIONPLUGIN void GetInstance(Fusion &f)
{
	fusion = &f;

	if(fusion->Input == NULL){
		fusion->Input = new DI8InputDeviceDB();

		if(fusion->Input->Initialise() == false){
			DestroyInstance();
		}
	}
}
开发者ID:christhomas,项目名称:fusionengine,代码行数:15,代码来源:DirectInput8_dll.cpp

示例8: GetInstance

//====================================
//	Creates the Network object
//====================================
FUSIONPLUGIN void GetInstance(Fusion &f)
{
	fusion = &f;

	if(fusion->Network == NULL){
		fusion->Network = new WSANetworkCore();

		if(fusion->Network->Initialise() == false){			
			DestroyInstance();
		}
	}
}
开发者ID:christhomas,项目名称:fusionengine,代码行数:15,代码来源:Win32Network_dll.cpp

示例9: DllMain

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
					 )
{
    switch (ul_reason_for_call) {
		case DLL_PROCESS_ATTACH:
			CreateInstance();
			break;
		case DLL_THREAD_ATTACH:
			break;
		case DLL_THREAD_DETACH:
			break;
		case DLL_PROCESS_DETACH:
			DestroyInstance();
			break;
    }
    return TRUE;
}
开发者ID:nizvoo,项目名称:ziputils,代码行数:19,代码来源:Export.c

示例10: TendTrash

void TendTrash(void)
{
  register unsigned c;
  register unsigned long i;
  register struct DumpRec *p;
  register struct gl_list_t *l;
  if (g_dump_inst_count <= MESSYTHRESH) return;
  for(c=0;c<DUMPHASHSIZE;c++) {
    p = g_dump_ht[c];
    while(p!=NULL) {
      if ((l=p->instances)!=NULL) {
	for (i=gl_length(l);i>MESSYTHRESH;i--) {
	  DestroyInstance((struct Instance *)gl_fetch(l,i),NULL);
	  g_dump_inst_count--;
	  gl_delete(l,i,0);
	}
      }
      p = p->next;
    }
  }
}
开发者ID:georgyberdyshev,项目名称:ascend,代码行数:21,代码来源:dump.c

示例11: while

void MapInstanced::Update(const uint32& t)
{
    // take care of loaded GridMaps (when unused, unload it!)
    Map::Update(t);

    // update the instanced maps
    InstancedMaps::iterator i = m_InstancedMaps.begin();

    while (i != m_InstancedMaps.end())
    {
        if (i->second->CanUnload(t))
        {
            DestroyInstance(i);                             // iterator incremented
        }
        else
        {
            // update only here, because it may schedule some bad things before delete
            i->second->Update(t);
            ++i;
        }
    }
}
开发者ID:Amara1231,项目名称:blizzlikecore,代码行数:22,代码来源:MapInstanced.cpp

示例12: TrashType

void TrashType(symchar *str)
{
  register unsigned long c,len,bucket;
  register struct DumpRec *p,*prev;
  register struct gl_list_t *l;
  register int cmp;
  assert(AscFindSymbol(str)!=NULL);
  if (*(SCP(str)) == '\0') return;
  bucket = DUMPHASHINDEX(SCP(str));
  if ((p = g_dump_ht[bucket])==NULL) return;
  cmp = CmpSymchar(p->type,str);
  if (cmp == 0)
    g_dump_ht[bucket] = p->next;
  else
    if (cmp > 0) return;
    else {
      prev = p;
      if ((p = p->next)==NULL) return;
      while((cmp=CmpSymchar(p->type,str))<0) {
	prev = p;
	if ((p=p->next)==NULL) return;
      }
      if (cmp!=0) return;
      /* remove from linked list */
      prev->next = p->next;
    }
  if ((l=p->instances)!=NULL) {
    len = gl_length(l);
    for(c=1;c<=len;c++)
      DestroyInstance((struct Instance *)gl_fetch(l,c),NULL);
    gl_destroy(l);
    g_dump_inst_count -= len;
  }
  g_dump_type_count--;
  ascfree((char *)p);
}
开发者ID:georgyberdyshev,项目名称:ascend,代码行数:36,代码来源:dump.c

示例13: DestroyInstance

void MapInstanced::DestroyInstance(uint32 InstanceId)
{
    InstancedMaps::iterator itr = m_InstancedMaps.find(InstanceId);
    if(itr != m_InstancedMaps.end())
        DestroyInstance(itr);
}
开发者ID:Choices,项目名称:mangos,代码行数:6,代码来源:MapInstanced.cpp

示例14: DestroyInstance

CImageDecoder::~CImageDecoder()
{
  DestroyInstance();
}
开发者ID:68foxboris,项目名称:xbmc,代码行数:4,代码来源:ImageDecoder.cpp

示例15: DdeUninitialize

/***************************************************************************\
* DdeUninitialize (DDEML API)
*
* Description:
* Shuts down a DDEML instance and frees all associated resources.
*
* History:
* 11-12-91 sanfords Created.
\***************************************************************************/
BOOL DdeUninitialize(
DWORD idInst)
{
    PCL_INSTANCE_INFO pcii, pciiPrev;
    BOOL fRet = FALSE;

    CheckDDECritOut;
    EnterDDECrit;

    pcii = ValidateInstance((HANDLE)LongToHandle( idInst ));
    if (pcii == NULL) {
        BestSetLastDDEMLError(DMLERR_INVALIDPARAMETER);
        goto Exit;
    }

    /*
     * If this thread is in the middle of a synchronous transaction or
     * a callback, we need to back out of those first.
     */
    if ((pcii->flags & IIF_IN_SYNC_XACT) || pcii->cInDDEMLCallback) {
        pcii->afCmd |= APPCMD_UNINIT_ASAP;
        fRet = TRUE;
        goto Exit;
    }

    ApplyFunctionToObjects(HTYPE_CONVERSATION_LIST, InstFromHandle(pcii->hInstClient),
            (PFNHANDLEAPPLY)DdeDisconnectList);
    ApplyFunctionToObjects(HTYPE_CLIENT_CONVERSATION, InstFromHandle(pcii->hInstClient),
            (PFNHANDLEAPPLY)DdeDisconnect);
    ApplyFunctionToObjects(HTYPE_SERVER_CONVERSATION, InstFromHandle(pcii->hInstClient),
            (PFNHANDLEAPPLY)DdeDisconnect);
    ApplyFunctionToObjects(HTYPE_ZOMBIE_CONVERSATION, InstFromHandle(pcii->hInstClient),
            (PFNHANDLEAPPLY)WaitForZombieTerminate);
    ApplyFunctionToObjects(HTYPE_DATA_HANDLE, InstFromHandle(pcii->hInstClient),
            (PFNHANDLEAPPLY)ApplyFreeDataHandle);

    LeaveDDECrit;
    NtUserCallOneParam((ULONG_PTR)pcii->hInstServer, SFI__CSDDEUNINITIALIZE);
    NtUserDestroyWindow(pcii->hwndMother);
    EnterDDECrit;

    DDEMLFree(pcii->plaNameService);
    DestroyInstance(pcii->hInstClient);

    // unlink pcii from pciiList

    if (pciiList == pcii) {
        pciiList = pciiList->next;
    } else {
        for (pciiPrev = pciiList; pciiPrev != NULL && pciiPrev->next != pcii;
                pciiPrev = pciiPrev->next) {
            ;
        }
        if (pciiPrev != NULL) {
            pciiPrev->next = pcii->next;
        }
    }
    DDEMLFree(pcii);
    fRet = TRUE;

Exit:
    LeaveDDECrit;
    return (fRet);
}
开发者ID:conioh,项目名称:os-design,代码行数:73,代码来源:ddemlcli.c


注:本文中的DestroyInstance函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。