Crash instead of leaking layers/textures between GL contexts
bug:17208461
Change-Id: I4d58f301cf0f5e8145e808a5d6ade4de7801970b
diff --git a/libs/hwui/Layer.cpp b/libs/hwui/Layer.cpp
index 8639ae1..e6bc4db 100644
--- a/libs/hwui/Layer.cpp
+++ b/libs/hwui/Layer.cpp
@@ -54,9 +54,11 @@
convexMask = NULL;
caches.resourceCache.incrementRefcount(this);
rendererLightPosDirty = true;
+ renderState.registerLayer(this);
}
Layer::~Layer() {
+ renderState.unregisterLayer(this);
SkSafeUnref(colorFilter);
removeFbo();
deleteTexture();