Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Issue 21277: Fix a memory leak caused by AudioRenedererHost. (Closed)

Created:
11 years, 10 months ago by Alpha Left Google
Modified:
9 years, 6 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Fix a memory leak caused by AudioRenedererHost. BUG=7608 AudioManager::CreateAudioManager() saves the instance in a static variable and let it leak, so don't call it until there's a better lifetime management of it.

Patch Set 1 #

Patch Set 2 : fix #

Total comments: 4

Patch Set 3 : fix #

Patch Set 4 : todo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -5 lines) Patch
M chrome/browser/renderer_host/audio_renderer_host.h View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/audio_renderer_host.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/audio_renderer_host_unittest.cc View 1 2 1 chunk +5 lines, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
Erik does not do reviews
http://codereview.chromium.org/21277/diff/4/1003 File chrome/browser/renderer_host/audio_renderer_host.cc (right): http://codereview.chromium.org/21277/diff/4/1003#newcode196 Line 196: // AudioManager::GetAudioManager(); Why not change AudioManager to use ...
11 years, 10 months ago (2009-02-12 00:40:26 UTC) #1
Alpha Left Google
http://codereview.chromium.org/21277/diff/4/1003 File chrome/browser/renderer_host/audio_renderer_host.cc (right): http://codereview.chromium.org/21277/diff/4/1003#newcode196 Line 196: // AudioManager::GetAudioManager(); On 2009/02/12 00:40:26, Erik Kay wrote: ...
11 years, 10 months ago (2009-02-12 01:16:00 UTC) #2
Erik does not do reviews
11 years, 10 months ago (2009-02-12 01:34:21 UTC) #3
LGTM

http://codereview.chromium.org/21277/diff/4/1003
File chrome/browser/renderer_host/audio_renderer_host.cc (right):

http://codereview.chromium.org/21277/diff/4/1003#newcode196
Line 196: // AudioManager::GetAudioManager();
On 2009/02/12 01:16:00, Alpha wrote:
> On 2009/02/12 00:40:26, Erik Kay wrote:
> > Why not change AudioManager to use base/Singleton?
> 
> ~AudioManager() is private, I need to talk to cpu to see how to change that
too.
> So it's good for the moment, nothing is actually using AudioRendererHost.

OK.  I think you should at least update the TODO to reflect the real problem
which is that you need to implement it as a proper Singleton.

FYI, it's common in Singleton use for the constructor to be private.  To work
around that, you need to add a friend declaration to your class, which would
also fix the private destructor problem (but perhaps not the underlying reason
that required the destructor to be private).

friend struct DefaultSingletonTraits<AudioManager>;

Powered by Google App Engine
This is Rietveld 408576698