Chromium Code Reviews| Index: content/renderer/pepper/pepper_graphics_2d_host.cc |
| diff --git a/content/renderer/pepper/pepper_graphics_2d_host.cc b/content/renderer/pepper/pepper_graphics_2d_host.cc |
| index 2c04d761460bc8a77ddadbe02c7270b60a4f8ff0..309a897d33eabda985b5ae76a85f59a244cf4fae 100644 |
| --- a/content/renderer/pepper/pepper_graphics_2d_host.cc |
| +++ b/content/renderer/pepper/pepper_graphics_2d_host.cc |
| @@ -42,11 +42,11 @@ PepperGraphics2DHost::PepperGraphics2DHost(RendererPpapiHost* host, |
| } |
| PepperGraphics2DHost::~PepperGraphics2DHost() { |
| - // Unbind from the instance when destoryed. |
| - PP_Instance instance = graphics_2d_->pp_instance(); |
| - ppapi::thunk::EnterInstanceNoLock enter(instance); |
| - if (enter.succeeded()) |
| - enter.functions()->BindGraphics(instance, 0); |
| + // Unbind from the instance when destoryed if we're still bound. |
|
bbudge
2012/12/14 00:24:26
sp destroyed
|
| + webkit::ppapi::PluginInstance* bound_instance = |
| + graphics_2d_->bound_instance(); |
| + if (bound_instance) |
| + bound_instance->BindGraphics(bound_instance->pp_instance(), 0); |
| } |
| int32_t PepperGraphics2DHost::OnResourceMessageReceived( |