git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32765 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-04-03 08:20:57 +00:00
parent 7eaee133a3
commit 267fc9c251
4 changed files with 16 additions and 7 deletions

View file

@ -1,3 +1,11 @@
2011-04-03 Richard Frith-Macdonald <rfm@gnu.org>
* Source/unix/GSRunLoopCtxt.m:
* Source/win32/GSRunLoopCtxt.m:
Fix pointer ownership issue in callbacks in GC environment so we let
the garbage collector handle watchers rather than trying to free them
explicitly when we shouldn't.
2011-04-03 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSObject.m: Fix problem with finalization of proxies and

View file

@ -58,7 +58,7 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
0
};
#else
#define WatcherMapValueCallBacks NSOwnedPointerMapValueCallBacks
#define WatcherMapValueCallBacks NSNonOwnedPointerMapValueCallBacks
#endif
@implementation GSRunLoopCtxt

View file

@ -45,7 +45,7 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
0
};
#else
#define WatcherMapValueCallBacks NSOwnedPointerMapValueCallBacks
#define WatcherMapValueCallBacks NSNonOwnedPointerMapValueCallBacks
#endif
@implementation GSRunLoopCtxt

View file

@ -15,6 +15,7 @@ int main()
NSDate *date;
NSMutableString *str;
NSFileHandle *fh = [NSFileHandle fileHandleWithStandardInput];
NSTimeInterval delay = 0.1;
[fh retain];
[fh readInBackgroundAndNotify];
@ -30,7 +31,7 @@ int main()
argument: @"foo"
order: 0
modes: [NSArray arrayWithObject: NSDefaultRunLoopMode]];
date = [NSDate dateWithTimeIntervalSinceNow: 0.1];
date = [NSDate dateWithTimeIntervalSinceNow: delay];
[run runUntilDate: date];
PASS([str isEqual: @"foo"],
"-performSelector:target:argument:order:modes: works for one performer");
@ -41,7 +42,7 @@ int main()
argument: @"foo"
order: 0
modes: [NSArray arrayWithObject: NSDefaultRunLoopMode]];
date = [NSDate dateWithTimeIntervalSinceNow: 0.1];
date = [NSDate dateWithTimeIntervalSinceNow: delay];
[run runUntilDate: date];
[run runUntilDate: date];
PASS([str isEqual: @"foo"],
@ -58,7 +59,7 @@ int main()
argument: @"foo"
order: 10
modes: [NSArray arrayWithObject: NSDefaultRunLoopMode]];
date = [NSDate dateWithTimeIntervalSinceNow: 0.1];
date = [NSDate dateWithTimeIntervalSinceNow: delay];
[run runUntilDate: date];
PASS([str isEqual: @"foobar"],
"-performSelector:target:argument:order:modes: orders performers correctly");
@ -82,7 +83,7 @@ int main()
[run cancelPerformSelector: @selector(appendString:)
target: str
argument: @"bar"];
date = [NSDate dateWithTimeIntervalSinceNow: 0.1];
date = [NSDate dateWithTimeIntervalSinceNow: delay];
[run runUntilDate: date];
PASS([str isEqual: @"foozot"],
"-cancelPerformSelector:target:argument: works");
@ -99,7 +100,7 @@ int main()
order: 11
modes: [NSArray arrayWithObject: NSDefaultRunLoopMode]];
[run cancelPerformSelectorsWithTarget: str];
date = [NSDate dateWithTimeIntervalSinceNow: 0.1];
date = [NSDate dateWithTimeIntervalSinceNow: delay];
[run runUntilDate: date];
PASS([str isEqualToString: @""], "-cancelPerformSelectorsWithTarget: works %s",[str cString]);