make sure to unlock the screenshot's buffer on destruction
this fixes a memory leak on various devices Bug: 8475134 Change-Id: I25924674c803a0cb22371a95c60664c36acb0340
This commit is contained in:
parent
437bdbbaec
commit
8000d0694b
@ -170,6 +170,7 @@ private:
|
||||
|
||||
public:
|
||||
ScreenshotClient();
|
||||
~ScreenshotClient();
|
||||
|
||||
// frees the previous screenshot and capture a new one
|
||||
status_t update(const sp<IBinder>& display);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user