From 8000d0694bc34bc17d869da546d8ff8790ae7be4 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Tue, 26 Mar 2013 18:15:35 -0700 Subject: make sure to unlock the screenshot's buffer on destruction this fixes a memory leak on various devices Bug: 8475134 Change-Id: I25924674c803a0cb22371a95c60664c36acb0340 --- libs/gui/SurfaceComposerClient.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libs') diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index ec46fce..f345df8 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -627,6 +627,10 @@ ScreenshotClient::ScreenshotClient() memset(&mBuffer, 0, sizeof(mBuffer)); } +ScreenshotClient::~ScreenshotClient() { + ScreenshotClient::release(); +} + sp ScreenshotClient::getCpuConsumer() const { if (mCpuConsumer == NULL) { mCpuConsumer = new CpuConsumer(1); -- cgit v1.1