diff options
author | ritsuka <[email protected]> | 2008-05-07 11:21:35 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2008-05-07 11:21:35 +0000 |
commit | 707962e0c733ca594a790ec5213eb85455b7dd64 (patch) | |
tree | c24549ba5c3467f4c77fa50c5d62eb6ee50d2be7 | |
parent | 79e0d5ba8237924372c5ef71c588b0f00245fb92 (diff) |
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
-rw-r--r-- | macosx/Controller.mm | 5 | ||||
-rw-r--r-- | macosx/HBPreferencesController.m | 3 |
2 files changed, 3 insertions, 5 deletions
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; } |