當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。