If you want to immediately uninstall a hook, the only way is to dispose it. A disposed
hook is guaranteed to never invoke your handler again but may still consume
memory even for process life-time!
Namespace:
EasyHook
Assembly:
EasyHook (in EasyHook.dll) Version: 2.7.6684.0 (2.7.6684.0)
Syntax public:
virtual void Dispose() sealed
abstract Dispose : unit -> unit
override Dispose : unit -> unit
Implements
IDisposableDisposeRemarks
As we are living in a manged world, you don't have to dispose a hook because the next
garbage collection will do it for you, assuming that your code does not reference it
anymore. But there are times when you want to uninstall it excplicitly, with no delay.
If you dispose a disposed or not installed hook, nothing will happen!
See Also