Skip to content

Commit

Permalink
Replace a scoped_ptr with scoped_array, as identified by valgrind.
Browse files Browse the repository at this point in the history
BUG=77653
TEST=FLACEncoder doesn't cause failures in valgrind

Review URL: http://codereview.chromium.org/6773007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79686 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
satish@chromium.org committed Mar 29, 2011
1 parent ce87f79 commit 93b4301
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
2 changes: 1 addition & 1 deletion content/browser/speech/audio_encoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void FLACEncoder::Encode(const short* samples, int num_samples) {
}

// FLAC encoder wants samples as int32s.
scoped_ptr<FLAC__int32> flac_samples(new FLAC__int32[num_samples]);
scoped_array<FLAC__int32> flac_samples(new FLAC__int32[num_samples]);
FLAC__int32* flac_samples_ptr = flac_samples.get();
for (int i = 0; i < num_samples; ++i)
flac_samples_ptr[i] = samples[i];
Expand Down
20 changes: 0 additions & 20 deletions tools/valgrind/memcheck/suppressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4110,26 +4110,6 @@
fun:g_object_new
fun:gtk_file_chooser_dialog_constructor
}
{
bug_77653_a
Memcheck:Free
fun:_ZdlPv
...
fun:_ZN10scoped_ptrIiED1Ev
fun:*FLACEncoder6EncodeEPKsi
fun:_ZN12speech_input16SpeechRecognizer12HandleOnDataEPSs
fun:_Z16DispatchToMethodIN12speech_input16SpeechRecognizerEMS1_FvPSsES2_EvPT_T0_RK6Tuple1IT1_E
fun:_ZN14RunnableMethodIN12speech_input16SpeechRecognizerEMS1_FvPSsE6Tuple1IS2_EE3RunEv
}
{
bug_77653_b
Memcheck:Free
fun:_ZdlPv
...
fun:_ZN10scoped_ptrIiED1Ev
fun:*FLACEncoder6EncodeEPKsi
fun:_ZN12speech_input16SpeechRecognizer13StopRecordingEv
}
{
bug_77712
Memcheck:Leak
Expand Down

0 comments on commit 93b4301

Please sign in to comment.