mirror of
https://github.com/gnustep/libs-ec.git
synced 2025-02-19 01:51:03 +00:00
backward cmpatibility tweak
This commit is contained in:
parent
d415fd6479
commit
2ce9916ae8
1 changed files with 16 additions and 3 deletions
19
Terminate.m
19
Terminate.m
|
@ -43,6 +43,9 @@
|
|||
#import "EcUserDefaults.h"
|
||||
#import "EcHost.h"
|
||||
|
||||
@protocol EcCommandOld
|
||||
- (oneway void) terminate;
|
||||
@end
|
||||
|
||||
int
|
||||
main()
|
||||
|
@ -130,8 +133,8 @@ main()
|
|||
else
|
||||
{
|
||||
NSConnection *c = [proxy connectionForProxy];
|
||||
unsigned active = [proxy activeCount];
|
||||
NSTimeInterval seconds = [defs doubleForKey: @"Wait"];
|
||||
unsigned active;
|
||||
NSDate *by;
|
||||
|
||||
if (isnan(seconds) || 0.0 == seconds)
|
||||
|
@ -147,8 +150,18 @@ main()
|
|||
seconds = 900.0;
|
||||
}
|
||||
by = [NSDate dateWithTimeIntervalSinceNow: seconds];
|
||||
[(id<Command>)proxy terminate: by];
|
||||
if (nil == [defs objectForKey: @"Wait"])
|
||||
if ([proxy respondsToSelector: @selector(activeCount)])
|
||||
{
|
||||
active = [proxy activeCount];
|
||||
[(id<Command>)proxy terminate: by];
|
||||
}
|
||||
else
|
||||
{
|
||||
active = 0;
|
||||
[(id<EcCommandOld>)proxy terminate];
|
||||
by = nil; // Waiting not supported with this API.
|
||||
}
|
||||
if (nil == by)
|
||||
{
|
||||
[c invalidate]; // No waiting
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue