Make sure tick is current before calling -newSecond:

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/performance/trunk@25207 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2007-05-30 09:29:17 +00:00
parent c414177897
commit ca1fee320f
2 changed files with 14 additions and 4 deletions

View file

@ -1,3 +1,7 @@
2007-05-30 Richard Frith-Macdonald <rfm@gnu.org>
* GSTicker.m: Ensure tick is current before calling -newSecond:
2007-04-01 Richard Frith-Macdonald <rfm@gnu.org>
* GSCache.m:

View file

@ -297,16 +297,22 @@ NSTimeInterval GSTickerTimeNow()
if (tt != nil && [tt->observers count] > 0)
{
NSTimeInterval ti;
NSArray *a = [tt->observers copy];
if (tt->theTimer != t)
{
[tt->theTimer invalidate];
tt->theTimer = nil;
}
[a makeObjectsPerformSelector: @selector(fire:)
withObject: tt->observers];
RELEASE(a);
if ([tt->observers count] > 0)
{
NSArray *a = [tt->observers copy];
GSTickerTimeNow();
[a makeObjectsPerformSelector: @selector(fire:)
withObject: tt->observers];
RELEASE(a);
}
ti = GSTickerTimeNow();
tt->theTimer = [NSTimer scheduledTimerWithTimeInterval: ti - (int)ti