Changeset 3690 for trunk/macosx/Controller.m
- Timestamp:
- Nov 2, 2007, 3:15:12 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.m
r3689 r3690 529 529 - (void) applicationWillTerminate: (NSNotification *) notification 530 530 { 531 //remove all torrent downloads 532 if (fPendingTorrentDownloads) 533 { 534 NSEnumerator * downloadEnumerator = [[fPendingTorrentDownloads allValues] objectEnumerator]; 535 NSDictionary * downloadDict; 536 NSURLDownload * download; 537 while ((downloadDict = [downloadEnumerator nextObject])) 538 { 539 download = [downloadDict objectForKey: @"Download"]; 540 [download cancel]; 541 [download release]; 542 } 543 [fPendingTorrentDownloads removeAllObjects]; 544 } 545 546 //remove all remaining torrent files in the temporary directory 547 if (fTempTorrentFiles) 548 { 549 NSEnumerator * torrentEnumerator = [fTempTorrentFiles objectEnumerator]; 550 NSString * path; 551 while ((path = [torrentEnumerator nextObject])) 552 [[NSFileManager defaultManager] removeFileAtPath: path handler: nil]; 553 [fTempTorrentFiles removeAllObjects]; 554 } 555 556 //stop timers 531 //stop timers and notification checking 532 [[NSNotificationCenter defaultCenter] removeObserver: self]; 533 557 534 [fTimer invalidate]; 558 535 [fSpeedLimitTimer invalidate]; … … 564 541 } 565 542 543 //remove all torrent downloads 544 if (fPendingTorrentDownloads) 545 { 546 NSEnumerator * downloadEnumerator = [[fPendingTorrentDownloads allValues] objectEnumerator]; 547 NSDictionary * downloadDict; 548 NSURLDownload * download; 549 while ((downloadDict = [downloadEnumerator nextObject])) 550 { 551 download = [downloadDict objectForKey: @"Download"]; 552 [download cancel]; 553 [download release]; 554 } 555 [fPendingTorrentDownloads removeAllObjects]; 556 } 557 558 //remove all remaining torrent files in the temporary directory 559 if (fTempTorrentFiles) 560 { 561 NSEnumerator * torrentEnumerator = [fTempTorrentFiles objectEnumerator]; 562 NSString * path; 563 while ((path = [torrentEnumerator nextObject])) 564 [[NSFileManager defaultManager] removeFileAtPath: path handler: nil]; 565 [fTempTorrentFiles removeAllObjects]; 566 } 567 566 568 //remember window states and close all windows 567 569 [fDefaults setBool: [[fInfoController window] isVisible] forKey: @"InfoVisible"]; … … 595 597 while ([startDate timeIntervalSinceNow] >= -5.0 && tr_handleStatus(fLib)->natTraversalStatus != TR_NAT_TRAVERSAL_DISABLED) 596 598 usleep(100000); 597 598 //remaining calls the same as dealloc599 [[NSNotificationCenter defaultCenter] removeObserver: self];600 599 601 600 [fInfoController release];
Note: See TracChangeset
for help on using the changeset viewer.