Timer Disposing

  • Thread starter Thread starter Adam
  • Start date Start date
A

Adam

I have code that has a timer object and after running for a while it
throws an error "Cannot access a disposed object named "Timer". Object
name: "Timer"."

I never dispose this object or any other object.

Does any one have any ideas what may be going on here.

Thanks
 
All Timer classes (System.Threading.Timer, System.Timers.Timer and
System.Windows.Forms.Timer) inherits from MarshalByRefObject class.
Consequently Timer classes object are subject to lifetime policy under
control of an ILease object. It is very likely that the lease expired at som
point in time and the timer has been disposed.
 
Back
Top