Timer.Dispose Method (WaitHandle)

Releases all resources used by the current instance of Timer and signals when the timer has been disposed of.

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

public bool Dispose (
	WaitHandle notifyObject
public boolean Dispose (
	WaitHandle notifyObject
public function Dispose (
	notifyObject : WaitHandle
) : boolean
Not applicable.



The WaitHandle to be signaled when the Timer has been disposed of.

Return Value

true if the function succeeds; otherwise, false.

Exception typeCondition


The notifyObject parameter is a null reference (Nothing in Visual Basic).

Calling Dispose allows the resources used by the Timer to be reallocated for other purposes. For more information about Dispose, see Cleaning Up Unmanaged Resources.

When this method completes, it signals the WaitHandle specified by the notifyObject parameter. Use this overload of the Dispose method if you want to be able to block until you are certain that the timer has been disposed.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions