From 707962e0c733ca594a790ec5213eb85455b7dd64 Mon Sep 17 00:00:00 2001 From: ritsuka Date: Wed, 7 May 2008 11:21:35 +0000 Subject: MacGUI: Fix toolbar item leaks for main and preferences windows. Patch by blindjimmy. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1453 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/Controller.mm | 5 ++--- macosx/HBPreferencesController.m | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'macosx') diff --git a/macosx/Controller.mm b/macosx/Controller.mm index ac83d40c1..449182106 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -724,8 +724,8 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It - (NSToolbarItem *) toolbar: (NSToolbar *)toolbar itemForItemIdentifier: (NSString *) itemIdent willBeInsertedIntoToolbar:(BOOL) willBeInserted { - NSToolbarItem * item = [[NSToolbarItem alloc] initWithItemIdentifier: itemIdent]; - + NSToolbarItem * item = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdent] autorelease]; + if ([itemIdent isEqualToString: ToggleDrawerIdentifier]) { [item setLabel: @"Toggle Presets"]; @@ -793,7 +793,6 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It } else { - [item release]; return nil; } diff --git a/macosx/HBPreferencesController.m b/macosx/HBPreferencesController.m index 6aa4b16ce..c2ad0c3d4 100644 --- a/macosx/HBPreferencesController.m +++ b/macosx/HBPreferencesController.m @@ -83,7 +83,7 @@ willBeInsertedIntoToolbar: (BOOL) flag { NSToolbarItem * item; - item = [[NSToolbarItem alloc] initWithItemIdentifier: ident]; + item = [[[NSToolbarItem alloc] initWithItemIdentifier: ident] autorelease]; if ([ident isEqualToString: TOOLBAR_GENERAL]) { @@ -119,7 +119,6 @@ } else { - [item release]; return nil; } -- cgit v1.2.3