New issue
Advanced search Search tips

Issue 753587 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Aug 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug
Team-Security-UX



Sign in to add a comment

Check for a view ownership memory leak in Cocoa Page Info

Project Member Reported by lgar...@chromium.org, Aug 8 2017

Issue description

I made a note about this a long time ago. I suspected the following line of having a memory leak, but I never followed up to check ownership:

[permissionsView_ setSubviews:[NSArray array]];

https://cs.chromium.org/chromium/src/chrome/browser/ui/cocoa/page_info/page_info_bubble_controller.mm?type=cs&q=%22%5BpermissionsView_+setSubviews:%5BNSArray+array%5D%5D;%22&sq=package:chromium&l=1212
 
I think it's OK :)

There's a few things doing this

chrome/browser/ui/cocoa/find_bar/find_bar_view_unittest.mm:  [view_ setSubviews:[NSArray array]];
chrome/browser/ui/cocoa/page_info/page_info_bubble_controller.mm:        setSubviews:[NSArray arrayWithObject:contentView_.get()]];
chrome/browser/ui/cocoa/page_info/page_info_bubble_controller.mm:  [permissionsView_ setSubviews:[NSArray array]];
chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm:  [contentView setSubviews:[NSArray array]];


@[] is another option

chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller.mm:  [contentView setSubviews:@[]];


the argument will just get autoreleased, and NSView is responsible for managing changes between the old and new arrays - https://developer.apple.com/documentation/appkit/nsview/1483539-subviews?language=objc
Status: WontFix (was: Available)
:-)

Sign in to add a comment