OSDN Git Service

drm_hwcomposer: Fix EGL_BAD_DISPLAY errors
authorSeason Li <seasonl@nvidia.com>
Thu, 8 Oct 2015 00:47:55 +0000 (17:47 -0700)
committerZach Reizner <zachr@google.com>
Fri, 9 Oct 2015 03:14:22 +0000 (20:14 -0700)
Dont call eglDestroyImageKHR in move construtor
since image_ and display_ are not initialized.

Google Issue: 44452

Change-Id: Ie20be3b021d4562f2cd8a89d2666307afcde1cf2

autogl.h

index 5d25e44..5eeca85 100644 (file)
--- a/autogl.h
+++ b/autogl.h
@@ -61,9 +61,10 @@ struct AutoEGLDisplayImage {
 
   AutoEGLDisplayImage(const AutoEGLDisplayImage& rhs) = delete;
   AutoEGLDisplayImage(AutoEGLDisplayImage&& rhs) {
-    clear();
-    std::swap(display_, rhs.display_);
-    std::swap(image_, rhs.image_);
+    display_ = rhs.display_;
+    image_ = rhs.image_;
+    rhs.display_ = EGL_NO_DISPLAY;
+    rhs.image_ = EGL_NO_IMAGE_KHR;
   }
 
   ~AutoEGLDisplayImage() {