mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Re-done commit
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15823 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
17d906ff14
commit
9815331816
2 changed files with 27 additions and 8 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2003-01-31 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSRunLoop.m: Fix memory leak with timed performs.
|
||||||
|
|
||||||
2003-01-31 Stephane Corthesy <stephane@sente.ch>
|
2003-01-31 Stephane Corthesy <stephane@sente.ch>
|
||||||
Adam Fedor <fedor@gnu.org>
|
Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
|
@ -18,6 +22,7 @@
|
||||||
|
|
||||||
* Source/libgnustep-base.def.in: Regenerated
|
* Source/libgnustep-base.def.in: Regenerated
|
||||||
|
|
||||||
|
>>>>>>> 1.1753
|
||||||
2003-01-27 Richard Frith-Macdonald <rfm@gnu.org>
|
2003-01-27 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/Additions/Unicode.m: Fixed bug in utf-8 output for three
|
* Source/Additions/Unicode.m: Fixed bug in utf-8 output for three
|
||||||
|
|
|
@ -253,6 +253,7 @@ static inline BOOL timerInvalidated(NSTimer* timer)
|
||||||
target: (id)target
|
target: (id)target
|
||||||
argument: (id)argument
|
argument: (id)argument
|
||||||
delay: (NSTimeInterval)delay;
|
delay: (NSTimeInterval)delay;
|
||||||
|
- (void) invalidate;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation GSTimedPerformer
|
@implementation GSTimedPerformer
|
||||||
|
@ -276,10 +277,7 @@ static inline BOOL timerInvalidated(NSTimer* timer)
|
||||||
|
|
||||||
- (void) gcFinalize
|
- (void) gcFinalize
|
||||||
{
|
{
|
||||||
if (timer != nil)
|
[self invalidate];
|
||||||
{
|
|
||||||
[timer invalidate];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithSelector: (SEL)aSelector
|
- (id) initWithSelector: (SEL)aSelector
|
||||||
|
@ -303,6 +301,16 @@ static inline BOOL timerInvalidated(NSTimer* timer)
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) invalidate
|
||||||
|
{
|
||||||
|
if (timer != nil)
|
||||||
|
{
|
||||||
|
[timer invalidate];
|
||||||
|
DESTROY(timer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@ -1198,6 +1206,7 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
||||||
|
|
||||||
if (p->target == target)
|
if (p->target == target)
|
||||||
{
|
{
|
||||||
|
[p invalidate];
|
||||||
[perf removeObjectAtIndex: count];
|
[perf removeObjectAtIndex: count];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1208,7 +1217,9 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
||||||
/**
|
/**
|
||||||
* Cancels any perform operations set up for the specified target
|
* Cancels any perform operations set up for the specified target
|
||||||
* in the current loop, but only if the value of aSelector and argument
|
* in the current loop, but only if the value of aSelector and argument
|
||||||
* with which the performs were set up exactly match those supplied.
|
* with which the performs were set up match those supplied.<br />
|
||||||
|
* Matching of the argument may be either by pointer equality or by
|
||||||
|
* use of the [NSObject-isEqual:] method.
|
||||||
*/
|
*/
|
||||||
+ (void) cancelPreviousPerformRequestsWithTarget: (id)target
|
+ (void) cancelPreviousPerformRequestsWithTarget: (id)target
|
||||||
selector: (SEL)aSelector
|
selector: (SEL)aSelector
|
||||||
|
@ -1229,8 +1240,9 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
||||||
GSTimedPerformer *p = array[count];
|
GSTimedPerformer *p = array[count];
|
||||||
|
|
||||||
if (p->target == target && sel_eq(p->selector, aSelector)
|
if (p->target == target && sel_eq(p->selector, aSelector)
|
||||||
&& [p->argument isEqual: arg])
|
&& (p->argument == arg || [p->argument isEqual: arg]))
|
||||||
{
|
{
|
||||||
|
[p invalidate];
|
||||||
[perf removeObjectAtIndex: count];
|
[perf removeObjectAtIndex: count];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2138,7 +2150,9 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
||||||
/**
|
/**
|
||||||
* Cancels any perform operations set up for the specified target
|
* Cancels any perform operations set up for the specified target
|
||||||
* in the receiver, but only if the value of aSelector and argument
|
* in the receiver, but only if the value of aSelector and argument
|
||||||
* with which the performs were set up exactly match those supplied.
|
* with which the performs were set up match those supplied.<br />
|
||||||
|
* Matching of the argument may be either by pointer equality or by
|
||||||
|
* use of the [NSObject-isEqual:] method.
|
||||||
*/
|
*/
|
||||||
- (void) cancelPerformSelector: (SEL)aSelector
|
- (void) cancelPerformSelector: (SEL)aSelector
|
||||||
target: (id) target
|
target: (id) target
|
||||||
|
@ -2163,7 +2177,7 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
||||||
|
|
||||||
p = GSIArrayItemAtIndex(performers, count).obj;
|
p = GSIArrayItemAtIndex(performers, count).obj;
|
||||||
if (p->target == target && sel_eq(p->selector, aSelector)
|
if (p->target == target && sel_eq(p->selector, aSelector)
|
||||||
&& p->argument == argument)
|
&& (p->argument == argument || [p->argument isEqual: argument]))
|
||||||
{
|
{
|
||||||
GSIArrayRemoveItemAtIndex(performers, count);
|
GSIArrayRemoveItemAtIndex(performers, count);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue