summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2013-03-27 01:30:36 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-03-27 01:30:36 +0000
commitcaa81f0ed8a4471c210956d0343458b3bca922de (patch)
tree9631e7e9b13e7852c56951afe7da880c5aa55c33
parent9dd8d897d350897eb04e60987bb59b846ea0f154 (diff)
parent8000d0694bc34bc17d869da546d8ff8790ae7be4 (diff)
downloadframeworks_native-caa81f0ed8a4471c210956d0343458b3bca922de.zip
frameworks_native-caa81f0ed8a4471c210956d0343458b3bca922de.tar.gz
frameworks_native-caa81f0ed8a4471c210956d0343458b3bca922de.tar.bz2
Merge "make sure to unlock the screenshot's buffer on destruction" into jb-mr2-dev
-rw-r--r--include/gui/SurfaceComposerClient.h1
-rw-r--r--libs/gui/SurfaceComposerClient.cpp4
2 files changed, 5 insertions, 0 deletions
diff --git a/include/gui/SurfaceComposerClient.h b/include/gui/SurfaceComposerClient.h
index 23655c7..6bf5b47 100644
--- a/include/gui/SurfaceComposerClient.h
+++ b/include/gui/SurfaceComposerClient.h
@@ -170,6 +170,7 @@ private:
public:
ScreenshotClient();
+ ~ScreenshotClient();
// frees the previous screenshot and capture a new one
status_t update(const sp<IBinder>& display);
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);