stop timers and notification checking on quit right away

This commit is contained in:
Mitchell Livingston
2007-11-02 03:13:44 +00:00
parent c5836d33e0
commit 4cb7eb603d
2 changed files with 3 additions and 4 deletions

View File

@@ -588,11 +588,11 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
[fBadger clearBadge];
//wait for running transfers to stop and for NAT to be disabled (5 second timeout)
NSDate * start = [NSDate date];
NSDate * startDate = [NSDate date];
tr_close(fLib);
while ([start timeIntervalSinceNow] >= -5.0 && tr_handleStatus(fLib)->natTraversalStatus != TR_NAT_TRAVERSAL_DISABLED)
while ([startDate timeIntervalSinceNow] >= -5.0 && tr_handleStatus(fLib)->natTraversalStatus != TR_NAT_TRAVERSAL_DISABLED)
usleep(100000);
//remaining calls the same as dealloc

View File

@@ -73,8 +73,7 @@
[[UKKQueue sharedFileWatcher] addPath: [autoPath stringByExpandingTildeInPath]];
//set bind port
int bindPort = [fDefaults integerForKey: @"BindPort"];
tr_setBindPort(fHandle, bindPort);
tr_setBindPort(fHandle, [fDefaults integerForKey: @"BindPort"]);
//set NAT
tr_natTraversalEnable(fHandle, [fDefaults boolForKey: @"NatTraversal"]);