summaryrefslogtreecommitdiffstats
path: root/libs/gui/SurfaceComposerClient.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2013-03-26 18:15:35 -0700
committerMathias Agopian <mathias@google.com>2013-03-26 18:15:35 -0700
commit8000d0694bc34bc17d869da546d8ff8790ae7be4 (patch)
tree9b1f6afe40b9648efddea30ccee71961a1a78e5f /libs/gui/SurfaceComposerClient.cpp
parent437bdbbaec76099b8b4582aa9f965e60b3f3cdb6 (diff)
downloadframeworks_native-8000d0694bc34bc17d869da546d8ff8790ae7be4.zip
frameworks_native-8000d0694bc34bc17d869da546d8ff8790ae7be4.tar.gz
frameworks_native-8000d0694bc34bc17d869da546d8ff8790ae7be4.tar.bz2
make sure to unlock the screenshot's buffer on destruction
this fixes a memory leak on various devices Bug: 8475134 Change-Id: I25924674c803a0cb22371a95c60664c36acb0340
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r--libs/gui/SurfaceComposerClient.cpp4
1 files changed, 4 insertions, 0 deletions
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<CpuConsumer> ScreenshotClient::getCpuConsumer() const {
if (mCpuConsumer == NULL) {
mCpuConsumer = new CpuConsumer(1);