| Index: ui/gl/gl_image_glx.cc
|
| diff --git a/ui/gl/gl_image_glx.cc b/ui/gl/gl_image_glx.cc
|
| index 4b7e883781cd8160e6bc6c49d38be238088fc6bd..4cd8c327591985ae99e4dbfa056d86ba9dc0d480 100644
|
| --- a/ui/gl/gl_image_glx.cc
|
| +++ b/ui/gl/gl_image_glx.cc
|
| @@ -49,7 +49,10 @@ GLImageGLX::GLImageGLX(gfx::PluginWindowHandle window)
|
| pixmap_(0),
|
| glx_pixmap_(0) {}
|
|
|
| -GLImageGLX::~GLImageGLX() { Destroy(); }
|
| +GLImageGLX::~GLImageGLX() {
|
| + DCHECK_EQ(0u, glx_pixmap_);
|
| + DCHECK_EQ(0u, pixmap_);
|
| +}
|
|
|
| bool GLImageGLX::Initialize() {
|
| if (!GLSurfaceGLX::IsTextureFromPixmapSupported()) {
|
| @@ -98,6 +101,10 @@ bool GLImageGLX::Initialize() {
|
|
|
| // Create backing pixmap reference.
|
| pixmap_ = XCompositeNameWindowPixmap(display_, window_);
|
| + if (!pixmap_) {
|
| + LOG(ERROR) << "XCompositeNameWindowPixmap failed.";
|
| + return false;
|
| + }
|
|
|
| XID root = 0;
|
| int x = 0;
|
| @@ -109,6 +116,8 @@ bool GLImageGLX::Initialize() {
|
| if (!XGetGeometry(
|
| display_, pixmap_, &root, &x, &y, &width, &height, &bw, &depth)) {
|
| LOG(ERROR) << "XGetGeometry failed for pixmap " << pixmap_ << ".";
|
| + XFreePixmap(display_, pixmap_);
|
| + pixmap_ = 0u;
|
| return false;
|
| }
|
|
|
| @@ -119,6 +128,8 @@ bool GLImageGLX::Initialize() {
|
| glXCreatePixmap(display_, *config.get(), pixmap_, pixmap_attribs);
|
| if (!glx_pixmap_) {
|
| LOG(ERROR) << "glXCreatePixmap failed.";
|
| + XFreePixmap(display_, pixmap_);
|
| + pixmap_ = 0u;
|
| return false;
|
| }
|
|
|
| @@ -126,7 +137,7 @@ bool GLImageGLX::Initialize() {
|
| return true;
|
| }
|
|
|
| -void GLImageGLX::Destroy() {
|
| +void GLImageGLX::Destroy(bool have_context) {
|
| if (glx_pixmap_) {
|
| glXDestroyGLXPixmap(display_, glx_pixmap_);
|
| glx_pixmap_ = 0;
|
|
|