Skip to content

Commit

Permalink
Removes MediaDecoderJob virtual method call from destructor.
Browse files Browse the repository at this point in the history
This execution path is currently seen used when destroying a
VideoDecoderJob that's still decoding:
* MediaDecoderJob::Release (early return, destroy_pending_=true)
* ...
* MediaDecoderJob::OnDecodeComplete
* ~VideoDecoderJob
* ~MediaDecoderJob
* MediaDecoderJob::ReleaseMediaCodecBridge
* MediaDecoderJob::OnMediaCodecBridgeReleased <-- !!!

The last line should be:
* VideoDecoderJob::OnMediaCodecBridgeReleased

but since it is invoked during the destructor the overridden
implementation is not executed.

R=qinmin@chromium.org,xhwang@chromium.org
BUG=internal b/17671489

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

Cr-Commit-Position: refs/heads/master@{#299159}
  • Loading branch information
gunsch authored and Commit bot committed Oct 10, 2014
1 parent a27b85e commit 6a1f7b5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion media/base/android/media_decoder_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ MediaDecoderJob::MediaDecoderJob(
}

MediaDecoderJob::~MediaDecoderJob() {
ReleaseMediaCodecBridge();
DCHECK(!media_codec_bridge_);
}

void MediaDecoderJob::OnDataReceived(const DemuxerData& data) {
Expand Down Expand Up @@ -232,6 +232,7 @@ void MediaDecoderJob::Release() {
return;
}

ReleaseMediaCodecBridge();
delete this;
}

Expand Down Expand Up @@ -500,6 +501,7 @@ void MediaDecoderJob::OnDecodeCompleted(

if (destroy_pending_) {
DVLOG(1) << __FUNCTION__ << " : completing pending deletion";
ReleaseMediaCodecBridge();
delete this;
return;
}
Expand Down

0 comments on commit 6a1f7b5

Please sign in to comment.