mirror of
https://github.com/transmission/transmission
synced 2025-02-20 13:16:53 +00:00
fix a tiny memory leak
This commit is contained in:
parent
169c259988
commit
7b42f87e50
1 changed files with 5 additions and 4 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue