Author: rfm
Date: Tue Jul 12 13:31:45 2016
New Revision: 39983
URL: http://svn.gna.org/viewcvs/gnustep?rev=39983&view=rev
Log:
Some behavior changes based on testing on OSX
Modified:
libs/base/trunk/ChangeLog
libs/base/trunk/Source/NSRunLoop.m
Modified: libs/base/trunk/ChangeLog
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/ChangeLog?rev=39983&r1=39982&r2=39983&view=diff
==============================================================================
--- libs/base/trunk/ChangeLog (original)
+++ libs/base/trunk/ChangeLog Tue Jul 12 13:31:45 2016
@@ -3,6 +3,10 @@
* Source/GSICUString.m (UTextNSStringAccess):
Fix to use signed integer variables so all the comparisons with zero
as a boundary actually work as intended etc (spotted by Wolfgang).
+ * Source/NSRunLoop.m: Closer to OSX behavior ... a nil date is treated
+ like a date in the distant past (ie loop terminates at once), and the
+ (-runUntilDate:) method fires any pending timers when given a date in
+ the past.
2016-07-12 Wolfgang Lux <[email protected]>
Modified: libs/base/trunk/Source/NSRunLoop.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSRunLoop.m?rev=39983&r1=39982&r2=39983&view=diff
==============================================================================
--- libs/base/trunk/Source/NSRunLoop.m (original)
+++ libs/base/trunk/Source/NSRunLoop.m Tue Jul 12 13:31:45 2016
@@ -1301,7 +1301,7 @@
/* Find out how long we can wait before first limit date.
*/
d = [self limitDateForMode: mode];
- if (d == nil)
+ if (nil == d || nil == date)
{
[arp drain];
return NO;
@@ -1311,10 +1311,7 @@
* Retain the date in case the firing of a timer (or some other event)
* releases it.
*/
- if (date != nil)
- {
- d = [d earlierDate: date];
- }
+ d = [d earlierDate: date];
[d retain];
/* Wait, listening to our input sources. */
@@ -1342,15 +1339,16 @@
*/
- (void) runUntilDate: (NSDate*)date
{
- double ti = [date timeIntervalSinceNow];
BOOL mayDoMore = YES;
/* Positive values are in the future. */
- while (ti > 0 && mayDoMore == YES)
- {
- NSDebugMLLog(@"NSRunLoop", @"run until date %f seconds from now", ti);
+ while (YES == mayDoMore)
+ {
mayDoMore = [self runMode: NSDefaultRunLoopMode beforeDate: date];
- ti = [date timeIntervalSinceNow];
+ if (nil == date || [date timeIntervalSinceNow] <= 0.0)
+ {
+ mayDoMore = NO;
+ }
}
}
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs