Results 1 to 4 of 4

Thread: Timers, GC

  1. #1

    Thread Starter
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Arrow Timers, GC

    Does a timer event maintained by an object keep firing during the period in between the object going out of scope and being gabage collected?

  2. #2

    Thread Starter
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Timers, GC

    I should clarify: By 'timer' I am referring to System.Threading.Timer, not another of the plethora of timer classes.

    I have one class-level field that holds a reference to this timer. However, what I'm seeing in the debug log suggests to me that three events are firing at once, which seems impossible unless there exist three System.Threading.Timer objects. If that were the case, two of them must be awaiting garbage collection, and I must not have disposed of them correctly. I would like clarification of whether that is possible or not, though.

  3. #3
    Lively Member dsuraj's Avatar
    Join Date
    Nov 2007
    Location
    Pune
    Posts
    70

    Re: Timers, GC

    thanks for sharing.

  4. #4

    Thread Starter
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Timers, GC

    No, thank you. Brilliant post. Solved my problem in one go.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width