diff --git a/include/gui/SurfaceComposerClient.h b/include/gui/SurfaceComposerClient.h index 23655c7ec..6bf5b47f9 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& display); diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index ec46fce40..f345df88b 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);