Skip to content

Commit

Permalink
Fix memory leaks in Mac code.
Browse files Browse the repository at this point in the history
Found with Mac OS X 'leaks' tool pointing at a Chromium debug
build started with MallocStackLogging=1

BUG=none

Review URL: https://codereview.chromium.org/719423004

Cr-Commit-Position: refs/heads/master@{#304286}
  • Loading branch information
asvitkine-chromium authored and Commit bot committed Nov 14, 2014
1 parent feac786 commit 9fcd06f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ - (void)setContentViewSubviews:(NSArray*)subviews {
}

// Remove all subviews that aren't the tabContentArea.
for (NSView* view in [[self.chromeContentView subviews] copy]) {
for (NSView* view in [[[self.chromeContentView subviews] copy] autorelease]) {
if (view != tabContentArea)
[view removeFromSuperview];
}
Expand Down
5 changes: 3 additions & 2 deletions content/browser/renderer_host/render_widget_host_view_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,9 @@ float FlipYFromRectToScreen(float y, float rect_height) {
// Paint this view host with |background_color_| when there is no content
// ready to draw.
background_layer_.reset([[CALayer alloc] init]);
[background_layer_
setBackgroundColor:gfx::CGColorCreateFromSkColor(background_color_)];
base::ScopedCFTypeRef<CGColorRef> background(
gfx::CGColorCreateFromSkColor(background_color_));
[background_layer_ setBackgroundColor:background];
[cocoa_view_ setLayer:background_layer_];
[cocoa_view_ setWantsLayer:YES];

Expand Down

0 comments on commit 9fcd06f

Please sign in to comment.