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

Unified Diff: content/renderer/pepper/ppb_graphics_3d_impl.cc

Issue 1881423004: Fix crash in PPB_Graphics3D_Impl destructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pepper: comment Created 4 years, 8 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: content/renderer/pepper/ppb_graphics_3d_impl.cc
diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.cc b/content/renderer/pepper/ppb_graphics_3d_impl.cc
index 691f524497ad9cc53dd90b6dff80e2ea31878c10..24c6513c12fb8119bb4d5ef6293d885dcc83d5e9 100644
--- a/content/renderer/pepper/ppb_graphics_3d_impl.cc
+++ b/content/renderer/pepper/ppb_graphics_3d_impl.cc
@@ -46,7 +46,10 @@ PPB_Graphics3D_Impl::PPB_Graphics3D_Impl(PP_Instance instance)
weak_ptr_factory_(this) {}
PPB_Graphics3D_Impl::~PPB_Graphics3D_Impl() {
- command_buffer_->SetGpuControlClient(nullptr);
+ // Unset the client before the command_buffer_ is destroyed, similar to how
+ // WeakPtrFactory invalidates before it.
+ if (command_buffer_)
+ command_buffer_->SetGpuControlClient(nullptr);
}
// static
« 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