From 1d4774233304c484673e2af2c1de2ab41021c979 Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Tue, 26 Aug 2014 17:30:15 -0700 Subject: Crash instead of leaking layers/textures between GL contexts bug:17208461 Change-Id: I4d58f301cf0f5e8145e808a5d6ade4de7801970b --- libs/hwui/RenderState.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libs/hwui/RenderState.cpp') diff --git a/libs/hwui/RenderState.cpp b/libs/hwui/RenderState.cpp index 97f379d04033..50b8f395011c 100644 --- a/libs/hwui/RenderState.cpp +++ b/libs/hwui/RenderState.cpp @@ -34,6 +34,10 @@ void RenderState::onGLContextCreated() { mCaches->init(); } +void RenderState::onGLContextDestroyed() { + LOG_ALWAYS_FATAL_IF(!mActiveLayers.empty(), "layers have survived gl context destruction"); +} + void RenderState::setViewport(GLsizei width, GLsizei height) { mViewportWidth = width; mViewportHeight = height; -- cgit v1.2.3-59-g8ed1b