Prevent random crashes on SGX architecture
Bug #6219894
Change-Id: If77f29da03e557a50e53bae505e1c638a1dbe2cc
diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp
index d7937c7..493dc1b 100644
--- a/libs/hwui/FontRenderer.cpp
+++ b/libs/hwui/FontRenderer.cpp
@@ -518,6 +518,8 @@
mCacheLines.clear();
if (mInitialized) {
+ // Unbinding the buffer shouldn't be necessary but it crashes with some drivers
+ Caches::getInstance().unbindIndicesBuffer();
glDeleteBuffers(1, &mIndexBufferID);
delete[] mTextMeshPtr;