Skip to main content

History: Talk:TimerManager

Source of version: 1 (current)

Copy to clipboard
            I modified the 'TimerMap::iterator i;' line to 'typedef TimerMap::iterator i;' to be safe, and to let it compile under g++.  Feel free to revert if this breaks anything, of course.

~pp~  void StopTimer( int Timer_ID ) 
  { 
    TimerMap::iterator i; 
    for( i = timers.begin(); i != timers.end(); ++i ) 
    { 
      if( i->second.Timer_ID == Timer_ID ) 
      { 
        timers.erase(i); 
        // we have to start our search over since erase invalidates our iterator 
        i = timers.begin(); 
      } 
    } 
  } 
~/pp~
((User:Codificate|Codificate)) 15:54, 8 July 2007 (BST)