Merge "Resize AutoCompleteTextView's dropdown when the list content changes. Bug #2517711"
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp
index 145e25e..89b3e1f 100644
--- a/opengl/libs/EGL/egl.cpp
+++ b/opengl/libs/EGL/egl.cpp
@@ -650,6 +650,7 @@
     if (dp->refs > 0) {
         if (major != NULL) *major = VERSION_MAJOR;
         if (minor != NULL) *minor = VERSION_MINOR;
+        dp->refs++;
         return EGL_TRUE;
     }
     
@@ -755,8 +756,10 @@
     }
 
     // this is specific to Android, display termination is ref-counted.
-    if (dp->refs > 1)
+    if (dp->refs > 1) {
+        dp->refs--;
         return EGL_TRUE;
+    }
 
     EGLBoolean res = EGL_FALSE;
     for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) {