From d4ec4542025fd80ec98a11938359fb0f8c6381b3 Mon Sep 17 00:00:00 2001 From: "piman@google.com" Date: Mon, 9 May 2011 23:59:42 +0000 Subject: Merge 84689 - Don't send Graphics3DContextLost after the instance is destroyed BUG=chromium-os:15057 TEST=manual Review URL: http://codereview.chromium.org/6969011 TBR=piman@google.com Review URL: http://codereview.chromium.org/6999002 git-svn-id: svn://svn.chromium.org/chrome/branches/742/src@84717 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/plugins/ppapi/ppb_surface_3d_impl.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'webkit/plugins') diff --git a/webkit/plugins/ppapi/ppb_surface_3d_impl.cc b/webkit/plugins/ppapi/ppb_surface_3d_impl.cc index b735c1d..f90591f 100644 --- a/webkit/plugins/ppapi/ppb_surface_3d_impl.cc +++ b/webkit/plugins/ppapi/ppb_surface_3d_impl.cc @@ -192,6 +192,11 @@ void PPB_Surface3D_Impl::OnContextLost() { } void PPB_Surface3D_Impl::SendContextLost() { + // By the time we run this, the instance may have been deleted, or in the + // process of being deleted. Even in the latter case, we don't want to send a + // callback after DidDestroy. + if (!instance() || !instance()->container()) + return; const PPP_Graphics3D_Dev* ppp_graphics_3d = static_cast( instance()->module()->GetPluginInterface( -- cgit v1.1