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

Unified Diff: ppapi/shared_impl/ppb_video_decoder_shared.cc

Issue 13123003: Flash: Don't lose a reference to the Graphics3D from the VideoDecoder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/ppb_video_decoder_proxy.cc ('k') | webkit/plugins/ppapi/ppb_video_decoder_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/ppb_video_decoder_shared.cc
diff --git a/ppapi/shared_impl/ppb_video_decoder_shared.cc b/ppapi/shared_impl/ppb_video_decoder_shared.cc
index ffd422d09979758f42fc6db044c9b1c5540d69d3..7d8d021b5b398156252ac8ac5e121aa58acf78f2 100644
--- a/ppapi/shared_impl/ppb_video_decoder_shared.cc
+++ b/ppapi/shared_impl/ppb_video_decoder_shared.cc
@@ -27,6 +27,8 @@ PPB_VideoDecoder_Shared::PPB_VideoDecoder_Shared(
}
PPB_VideoDecoder_Shared::~PPB_VideoDecoder_Shared() {
+ // Destroy() must be called before the object is destroyed.
+ DCHECK(graphics_context_ == 0);
}
thunk::PPB_VideoDecoder_API* PPB_VideoDecoder_Shared::AsPPB_VideoDecoder_API() {
@@ -44,9 +46,12 @@ void PPB_VideoDecoder_Shared::InitCommon(
}
void PPB_VideoDecoder_Shared::Destroy() {
- graphics_context_ = 0;
+ if (graphics_context_) {
+ PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource(
+ graphics_context_);
+ graphics_context_ = 0;
+ }
gles2_impl_ = NULL;
- PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource(graphics_context_);
}
bool PPB_VideoDecoder_Shared::SetFlushCallback(
« no previous file with comments | « ppapi/proxy/ppb_video_decoder_proxy.cc ('k') | webkit/plugins/ppapi/ppb_video_decoder_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698