From 7b42f87e50570ecf6884852c20720b462727840e Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Mon, 14 Jan 2008 04:34:45 +0000 Subject: [PATCH] fix a tiny memory leak --- macosx/Controller.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index 73b95a0ed..76aa06409 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -754,6 +754,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi if (tr_torrentParse(fLib, ctor, &info) == TR_EDUPLICATE) { [self duplicateOpenAlert: [NSString stringWithUTF8String: info.name]]; + tr_ctorFree(ctor); tr_metainfoFree(&info); continue; } @@ -772,20 +773,20 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi //determine to show the options window BOOL showWindow = type == ADD_SHOW_OPTIONS || ([fDefaults boolForKey: @"DownloadAsk"] - && (![fDefaults boolForKey: @"DownloadAskMulti"] || info.isMultifile)); + && (info.isMultifile || ![fDefaults boolForKey: @"DownloadAskMulti"])); tr_metainfoFree(&info); if (!(torrent = [[Torrent alloc] initWithPath: torrentPath location: location deleteTorrentFile: showWindow ? TORRENT_FILE_SAVE : deleteTorrentFile lib: fLib])) continue; - //add it to the "File -> Open Recent" menu - [[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL: [NSURL fileURLWithPath: torrentPath]]; - //verify the data right away if it was newly created if (type == ADD_CREATED) [torrent resetCache]; + //add it to the "File -> Open Recent" menu + [[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL: [NSURL fileURLWithPath: torrentPath]]; + //show the add window or add directly if (showWindow || !location) {