Hide

YetaWF.Core Package Documentation

Display
Print

YetaWF.Core.Support.DisposableTracker Class

Keeps track of objects that implement the IDisposable interface so objects that are not disposed can be located.

Disposable objects implement the IDisposable interface. Their creation/destruction is tracked using the DisposableTracker class. Admin > Dashboard > Disposable Tracker (standard YetaWF site) can be used to review and objects that are currently tracked. If objects are shown they should be checked as they are possible leaks.

Some classes deliberately create near permanent disposable object. These are SiteDefinition, LanguageData and LogRecordDataProvider and some other. More than one object may be created per class. Only objects with explicit calls to DisposableTracker.AddObject/RemoveObject are tracked.

Namespace: YetaWF.Core.Support
Assembly: YetaWF.Core

Inheritance

Syntax

public static class DisposableTracker;

Constructors

This class cannot be instantiated.

Properties

PublicStaticUseTrackerReturns whether objects are tracked. This is defined using AppSettings.json.

Methods

PublicStaticAddObjectAdds an object to track.
PublicInherited from System.ObjectEqualsDetermines whether the specified object is equal to the current object.
ProtectedInherited from System.ObjectFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
PublicStaticGetDisposableObjectsReturns a collection of all tracked objects that have not yet been disposed.
PublicInherited from System.ObjectGetHashCodeServes as the default hash function.
PublicInherited from System.ObjectGetTypeGets the Type of the current instance.
ProtectedInherited from System.ObjectMemberwiseCloneCreates a shallow copy of the current Object.
PublicStaticInherited from System.ObjectReferenceEqualsDetermines whether the specified Object instances are the same instance.
PublicStaticRemoveObjectRemoves a tracked object, meaning it is being disposed.
PublicInherited from System.ObjectToStringReturns a string that represents the current object.

See Also YetaWF.Core Overview