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

Unified Diff: content/common/gpu/image_transport_surface_android.cc

Issue 12038095: Android webview fix gpu crashes after destroy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: SetNativeWidget in ~SurfaceTextureTransportClient Created 7 years, 11 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
Index: content/common/gpu/image_transport_surface_android.cc
diff --git a/content/common/gpu/image_transport_surface_android.cc b/content/common/gpu/image_transport_surface_android.cc
index f476f7554c472a8589fe08616dfd27da0ee4d72c..72e098a9f78e350e0d58aa923765f72f89eb86f7 100644
--- a/content/common/gpu/image_transport_surface_android.cc
+++ b/content/common/gpu/image_transport_surface_android.cc
@@ -23,9 +23,11 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface(
DCHECK(GpuSurfaceLookup::GetInstance());
ANativeWindow* window = GpuSurfaceLookup::GetInstance()->GetNativeWidget(
stub->surface_id());
- DCHECK(window);
surface = new gfx::NativeViewGLSurfaceEGL(false, window);
- if (!surface.get() || !surface->Initialize())
+ bool initialize_success = surface->Initialize();
+ if (window)
+ ANativeWindow_release(window);
+ if (!initialize_success)
return NULL;
surface = new PassThroughImageTransportSurface(
@@ -35,9 +37,9 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface(
return NULL;
}
- if (surface->Initialize())
+ if (surface->Initialize()) {
return surface;
- else {
+ } else {
LOG(ERROR) << "Failed to initialize ImageTransportSurface";
return NULL;
}

Powered by Google App Engine
This is Rietveld 408576698