mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Fix memory problems
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4474 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
203b566de3
commit
51c007955e
2 changed files with 18 additions and 8 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Jun 25 11:30:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
|
* Source/NSRunLoop.m: Use autorelease pools in ([limitDateForMode:])
|
||||||
|
and ([acceptInputForMode:beforeDate:])
|
||||||
|
|
||||||
Thu Jun 24 20:30:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
Thu Jun 24 20:30:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
* Source/include/GSIMap.h: Tweaks to avoid compiler warnings.
|
* Source/include/GSIMap.h: Tweaks to avoid compiler warnings.
|
||||||
|
|
|
@ -619,19 +619,15 @@ static NSComparisonResult aSort(GSIArrayItem i0, GSIArrayItem i1)
|
||||||
|
|
||||||
- (void) runUntilDate: date forMode: (NSString*)mode
|
- (void) runUntilDate: date forMode: (NSString*)mode
|
||||||
{
|
{
|
||||||
volatile double ti;
|
double ti = [date timeIntervalSinceNow];
|
||||||
BOOL mayDoMore = YES;
|
BOOL mayDoMore = YES;
|
||||||
|
|
||||||
ti = [date timeIntervalSinceNow];
|
|
||||||
/* Positive values are in the future. */
|
/* Positive values are in the future. */
|
||||||
while (ti > 0 && mayDoMore == YES)
|
while (ti > 0 && mayDoMore == YES)
|
||||||
{
|
{
|
||||||
CREATE_AUTORELEASE_POOL(arp);
|
|
||||||
|
|
||||||
if (debug_run_loop)
|
if (debug_run_loop)
|
||||||
printf ("\tNSRunLoop run until date %f seconds from now\n", ti);
|
printf ("\tNSRunLoop run until date %f seconds from now\n", ti);
|
||||||
mayDoMore = [self runMode: mode beforeDate: date];
|
mayDoMore = [self runMode: mode beforeDate: date];
|
||||||
RELEASE(arp);
|
|
||||||
ti = [date timeIntervalSinceNow];
|
ti = [date timeIntervalSinceNow];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -786,6 +782,7 @@ const NSMapTableValueCallBacks ArrayMapValueCallBacks =
|
||||||
|
|
||||||
- (NSDate*) limitDateForMode: (NSString*)mode
|
- (NSDate*) limitDateForMode: (NSString*)mode
|
||||||
{
|
{
|
||||||
|
CREATE_AUTORELEASE_POOL(arp);
|
||||||
id saved_mode;
|
id saved_mode;
|
||||||
NSDate *when;
|
NSDate *when;
|
||||||
GSIArray timers;
|
GSIArray timers;
|
||||||
|
@ -906,6 +903,7 @@ const NSMapTableValueCallBacks ArrayMapValueCallBacks =
|
||||||
}
|
}
|
||||||
|
|
||||||
_current_mode = saved_mode;
|
_current_mode = saved_mode;
|
||||||
|
RELEASE(arp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If there are timers - set limit date to the earliest of them.
|
* If there are timers - set limit date to the earliest of them.
|
||||||
|
@ -1009,6 +1007,7 @@ const NSMapTableValueCallBacks ArrayMapValueCallBacks =
|
||||||
- (void) acceptInputForMode: (NSString*)mode
|
- (void) acceptInputForMode: (NSString*)mode
|
||||||
beforeDate: limit_date
|
beforeDate: limit_date
|
||||||
{
|
{
|
||||||
|
CREATE_AUTORELEASE_POOL(arp);
|
||||||
NSTimeInterval ti;
|
NSTimeInterval ti;
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
void *select_timeout;
|
void *select_timeout;
|
||||||
|
@ -1053,6 +1052,7 @@ const NSMapTableValueCallBacks ArrayMapValueCallBacks =
|
||||||
if (debug_run_loop)
|
if (debug_run_loop)
|
||||||
printf ("\tNSRunLoop limit date past, returning\n");
|
printf ("\tNSRunLoop limit date past, returning\n");
|
||||||
_current_mode = saved_mode;
|
_current_mode = saved_mode;
|
||||||
|
RELEASE(arp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1178,6 +1178,7 @@ const NSMapTableValueCallBacks ArrayMapValueCallBacks =
|
||||||
GSNotifyIdle();
|
GSNotifyIdle();
|
||||||
[self _checkPerformers];
|
[self _checkPerformers];
|
||||||
_current_mode = saved_mode;
|
_current_mode = saved_mode;
|
||||||
|
RELEASE(arp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1254,6 +1255,7 @@ const NSMapTableValueCallBacks ArrayMapValueCallBacks =
|
||||||
[self _checkPerformers];
|
[self _checkPerformers];
|
||||||
GSNotifyASAP();
|
GSNotifyASAP();
|
||||||
_current_mode = saved_mode;
|
_current_mode = saved_mode;
|
||||||
|
RELEASE(arp);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) runMode: (NSString*)mode beforeDate: date
|
- (BOOL) runMode: (NSString*)mode beforeDate: date
|
||||||
|
@ -1282,9 +1284,12 @@ const NSMapTableValueCallBacks ArrayMapValueCallBacks =
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Use the earlier of the two dates we have. */
|
/*
|
||||||
|
* Use the earlier of the two dates we have.
|
||||||
|
* Retain the date in case the firing of a timer (or some other event)
|
||||||
|
* releases it.
|
||||||
|
*/
|
||||||
d = [d earlierDate: date];
|
d = [d earlierDate: date];
|
||||||
|
|
||||||
RETAIN(d);
|
RETAIN(d);
|
||||||
|
|
||||||
/* Wait, listening to our input sources. */
|
/* Wait, listening to our input sources. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue