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

Unified Diff: ppapi/proxy/ppp_video_decoder_proxy.cc

Issue 15039003: PPAPI: Check for NULL dispatcher in PPP_VideoDecoder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppp_video_decoder_proxy.cc
diff --git a/ppapi/proxy/ppp_video_decoder_proxy.cc b/ppapi/proxy/ppp_video_decoder_proxy.cc
index a24d4c3a05ab7f6ffa60aff6f52579716dfbbc9d..f1a672127911ec4177fbcd39320ac4390dc8a013 100644
--- a/ppapi/proxy/ppp_video_decoder_proxy.cc
+++ b/ppapi/proxy/ppp_video_decoder_proxy.cc
@@ -59,9 +59,15 @@ void NotifyError(PP_Instance instance, PP_Resource decoder,
HostResource decoder_resource;
decoder_resource.SetHostResource(instance, decoder);
- HostDispatcher::GetForInstance(instance)->Send(
+ // It's possible that the error we're being notified about is happening
+ // because the instance is shutting down. In this case, our instance may
+ // already have been removed from the HostDispatcher map.
+ HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance);
+ if (dispatcher) {
+ dispatcher->Send(
new PpapiMsg_PPPVideoDecoder_NotifyError(
API_ID_PPP_VIDEO_DECODER_DEV, decoder_resource, error));
+ }
}
static const PPP_VideoDecoder_Dev video_decoder_interface = {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698