Index: src/OFTimer.h ================================================================== --- src/OFTimer.h +++ src/OFTimer.h @@ -36,11 +36,11 @@ uint8_t arguments; BOOL repeats; #ifdef OF_HAVE_BLOCKS of_timer_block_t block; #endif - BOOL isValid; + BOOL isValid, done; OFCondition *condition; } /** * \brief Creates and schedules a new timer with the specified time interval. Index: src/OFTimer.m ================================================================== --- src/OFTimer.m +++ src/OFTimer.m @@ -367,12 +367,16 @@ #ifdef OF_HAVE_BLOCKS } #endif [condition lock]; - [condition signal]; - [condition unlock]; + @try { + done = YES; + [condition signal]; + } @finally { + [condition unlock]; + } if (repeats && isValid) { OFDate *old = fireDate; fireDate = [[OFDate alloc] initWithTimeIntervalSinceNow: interval]; @@ -404,9 +408,17 @@ } - (void)waitUntilDone { [condition lock]; - [condition wait]; - [condition unlock]; + @try { + if (done) { + done = NO; + return; + } + + [condition wait]; + } @finally { + [condition unlock]; + } } @end