Marshal.AreComObjectsAvailableForCleanup Método
Definição
Indica se RCWs (Runtime Callable Wrappers) de qualquer contexto estão disponíveis para limpeza.Indicates whether runtime callable wrappers (RCWs) from any context are available for cleanup.
public:
static bool AreComObjectsAvailableForCleanup();
[System.Security.SecurityCritical]
public static bool AreComObjectsAvailableForCleanup ();
static member AreComObjectsAvailableForCleanup : unit -> bool
Public Shared Function AreComObjectsAvailableForCleanup () As Boolean
Retornos
true
se houver algum RCW disponível para limpeza; caso contrário, false
.true
if there are any RCWs available for cleanup; otherwise, false
.
- Atributos
Comentários
Se houver muitas referências entre código gerenciado e nativo com grafos de dependência profunda, pode levar muito tempo para que todos os objetos sejam limpos.If there are a lot of references between managed and native code with deep dependency graphs it can take a long time for all the objects to clean up. Cada vez que um GC é executado, ele liberará algum número de RCWs, que, por sua vez, liberará os objetos COM subjacentes.Each time a GC runs it will free up some number of RCWs, which will in turn release the underlying COM objects. Em seguida, esses objetos COM liberam suas referências gerenciadas e disponibilizam mais objetos para limpeza na próxima vez em que um GC for executado, o que iniciará o processo novamente.Those COM objects will then release their managed references and make more objects available for cleanup the next time a GC runs, which starts the process over again.
O método AreComObjectsAvailableForCleanup fornece uma maneira para o aplicativo determinar quantos ciclos de GC. Coletar e GC. WaitForPendingFinalizers precisa acontecer para limpar tudo.The AreComObjectsAvailableForCleanup method provides a way for the application to determine how many cycles of GC.Collect and GC.WaitForPendingFinalizers need to happen in order to clean everything up.
Segurança
SecurityCriticalAttribute
requer confiança total para o chamador imediato.requires full trust for the immediate caller. Este membro não pode ser usado pelo código transparente ou parcialmente confiável.This member cannot be used by partially trusted or transparent code.