Dieser Artikel wurde maschinell übersetzt. Wenn Sie die englische Version des Artikels anzeigen möchten, aktivieren Sie das Kontrollkästchen Englisch. Sie können den englischen Text auch in einem Popupfenster anzeigen, indem Sie den Mauszeiger über den Text bewegen.
Übersetzung
Englisch

Thread.DisableComObjectEagerCleanup-Methode: ()

.NET Framework (current version)
 

Deaktiviert die automatische Bereinigung von Runtime Callable Wrappern (RCW) für den aktuellen Thread.

Namespace:   System.Threading
Assembly:  mscorlib (in mscorlib.dll)

[SecurityCriticalAttribute]
public void DisableComObjectEagerCleanup()

By default, the common language runtime (CLR) cleans up runtime callable wrappers automatically. The CLR pumps messages during the cleanup, which might cause reentrancy problems for a few applications that meet the following unusual criteria:

  • The application does its own message pumping.

  • The application needs to control precisely when message pumping occurs.

Such applications can use the M:System.Threading.Thread.DisableComObjectEagerCleanup method to prevent the CLR from doing automatic reclamation of runtime callable wrappers.

When this method has been called on a thread, automatic cleanup cannot be re-enabled for that thread. When your application is ready to clean up runtime callable wrappers, use the M:System.Runtime.InteropServices.Marshal.CleanupUnusedObjectsInCurrentContext method to instruct the runtime to clean up all runtime callable wrappers in the current context. Message pumping occurs while the method executes.

SecurityCriticalAttribute

Requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

.NET Framework
Verfügbar seit 4.0
Zurück zum Anfang
Anzeigen: