mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
GC fixup
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32765 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
23fc4889d1
commit
b1a7add38e
4 changed files with 16 additions and 7 deletions
|
@ -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>
|
2011-04-03 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSObject.m: Fix problem with finalization of proxies and
|
* Source/NSObject.m: Fix problem with finalization of proxies and
|
||||||
|
|
|
@ -58,7 +58,7 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
#define WatcherMapValueCallBacks NSOwnedPointerMapValueCallBacks
|
#define WatcherMapValueCallBacks NSNonOwnedPointerMapValueCallBacks
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@implementation GSRunLoopCtxt
|
@implementation GSRunLoopCtxt
|
||||||
|
|
|
@ -45,7 +45,7 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
#define WatcherMapValueCallBacks NSOwnedPointerMapValueCallBacks
|
#define WatcherMapValueCallBacks NSNonOwnedPointerMapValueCallBacks
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@implementation GSRunLoopCtxt
|
@implementation GSRunLoopCtxt
|
||||||
|
|
|
@ -15,6 +15,7 @@ int main()
|
||||||
NSDate *date;
|
NSDate *date;
|
||||||
NSMutableString *str;
|
NSMutableString *str;
|
||||||
NSFileHandle *fh = [NSFileHandle fileHandleWithStandardInput];
|
NSFileHandle *fh = [NSFileHandle fileHandleWithStandardInput];
|
||||||
|
NSTimeInterval delay = 0.1;
|
||||||
|
|
||||||
[fh retain];
|
[fh retain];
|
||||||
[fh readInBackgroundAndNotify];
|
[fh readInBackgroundAndNotify];
|
||||||
|
@ -30,7 +31,7 @@ int main()
|
||||||
argument: @"foo"
|
argument: @"foo"
|
||||||
order: 0
|
order: 0
|
||||||
modes: [NSArray arrayWithObject: NSDefaultRunLoopMode]];
|
modes: [NSArray arrayWithObject: NSDefaultRunLoopMode]];
|
||||||
date = [NSDate dateWithTimeIntervalSinceNow: 0.1];
|
date = [NSDate dateWithTimeIntervalSinceNow: delay];
|
||||||
[run runUntilDate: date];
|
[run runUntilDate: date];
|
||||||
PASS([str isEqual: @"foo"],
|
PASS([str isEqual: @"foo"],
|
||||||
"-performSelector:target:argument:order:modes: works for one performer");
|
"-performSelector:target:argument:order:modes: works for one performer");
|
||||||
|
@ -41,7 +42,7 @@ int main()
|
||||||
argument: @"foo"
|
argument: @"foo"
|
||||||
order: 0
|
order: 0
|
||||||
modes: [NSArray arrayWithObject: NSDefaultRunLoopMode]];
|
modes: [NSArray arrayWithObject: NSDefaultRunLoopMode]];
|
||||||
date = [NSDate dateWithTimeIntervalSinceNow: 0.1];
|
date = [NSDate dateWithTimeIntervalSinceNow: delay];
|
||||||
[run runUntilDate: date];
|
[run runUntilDate: date];
|
||||||
[run runUntilDate: date];
|
[run runUntilDate: date];
|
||||||
PASS([str isEqual: @"foo"],
|
PASS([str isEqual: @"foo"],
|
||||||
|
@ -58,7 +59,7 @@ int main()
|
||||||
argument: @"foo"
|
argument: @"foo"
|
||||||
order: 10
|
order: 10
|
||||||
modes: [NSArray arrayWithObject: NSDefaultRunLoopMode]];
|
modes: [NSArray arrayWithObject: NSDefaultRunLoopMode]];
|
||||||
date = [NSDate dateWithTimeIntervalSinceNow: 0.1];
|
date = [NSDate dateWithTimeIntervalSinceNow: delay];
|
||||||
[run runUntilDate: date];
|
[run runUntilDate: date];
|
||||||
PASS([str isEqual: @"foobar"],
|
PASS([str isEqual: @"foobar"],
|
||||||
"-performSelector:target:argument:order:modes: orders performers correctly");
|
"-performSelector:target:argument:order:modes: orders performers correctly");
|
||||||
|
@ -82,7 +83,7 @@ int main()
|
||||||
[run cancelPerformSelector: @selector(appendString:)
|
[run cancelPerformSelector: @selector(appendString:)
|
||||||
target: str
|
target: str
|
||||||
argument: @"bar"];
|
argument: @"bar"];
|
||||||
date = [NSDate dateWithTimeIntervalSinceNow: 0.1];
|
date = [NSDate dateWithTimeIntervalSinceNow: delay];
|
||||||
[run runUntilDate: date];
|
[run runUntilDate: date];
|
||||||
PASS([str isEqual: @"foozot"],
|
PASS([str isEqual: @"foozot"],
|
||||||
"-cancelPerformSelector:target:argument: works");
|
"-cancelPerformSelector:target:argument: works");
|
||||||
|
@ -99,7 +100,7 @@ int main()
|
||||||
order: 11
|
order: 11
|
||||||
modes: [NSArray arrayWithObject: NSDefaultRunLoopMode]];
|
modes: [NSArray arrayWithObject: NSDefaultRunLoopMode]];
|
||||||
[run cancelPerformSelectorsWithTarget: str];
|
[run cancelPerformSelectorsWithTarget: str];
|
||||||
date = [NSDate dateWithTimeIntervalSinceNow: 0.1];
|
date = [NSDate dateWithTimeIntervalSinceNow: delay];
|
||||||
[run runUntilDate: date];
|
[run runUntilDate: date];
|
||||||
PASS([str isEqualToString: @""], "-cancelPerformSelectorsWithTarget: works %s",[str cString]);
|
PASS([str isEqualToString: @""], "-cancelPerformSelectorsWithTarget: works %s",[str cString]);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue