diff options
| author | 2022-06-29 22:13:49 +0000 | |
|---|---|---|
| committer | 2022-06-29 22:14:26 +0000 | |
| commit | 728dba1f95927d8f7acb52d09c65c486f81ea50d (patch) | |
| tree | 6af44e4169ebd158a23fe1eb4124aaa99fbc4d45 | |
| parent | 715b4413b93d90c9d2a1f559c9b0fac69dd09f4f (diff) | |
BBQ: Remove BufferFreedListener
If BBQ is destroyed without calling abandon, its BufferItemConsumer
will call onBufferFreed. Since BBQ registers itself as the
BufferFreedListener we end up trying to promote and destroy the
BBQ again. The BufferFreedListener is not used so as a simple fix,
we remove the listener.
Test: presubmit
Bug: 200246498
Change-Id: I7b2be265b3c09d691cc0c41b80c73067f9a8b84d
| -rw-r--r-- | libs/gui/BLASTBufferQueue.cpp | 2 | ||||
| -rw-r--r-- | libs/gui/include/gui/BLASTBufferQueue.h | 5 |
2 files changed, 1 insertions, 6 deletions
diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp index f34061492a..77022dc9b8 100644 --- a/libs/gui/BLASTBufferQueue.cpp +++ b/libs/gui/BLASTBufferQueue.cpp @@ -159,7 +159,6 @@ BLASTBufferQueue::BLASTBufferQueue(const std::string& name, bool updateDestinati id++; mBufferItemConsumer->setName(String8(consumerName.c_str())); mBufferItemConsumer->setFrameAvailableListener(this); - mBufferItemConsumer->setBufferFreedListener(this); ComposerServiceAIDL::getComposerService()->getMaxAcquiredBufferCount(&mMaxAcquiredBuffers); mBufferItemConsumer->setMaxAcquiredBufferCount(mMaxAcquiredBuffers); @@ -1114,7 +1113,6 @@ void BLASTBufferQueue::abandon() { if (mBufferItemConsumer != nullptr) { mBufferItemConsumer->abandon(); mBufferItemConsumer->setFrameAvailableListener(nullptr); - mBufferItemConsumer->setBufferFreedListener(nullptr); } mBufferItemConsumer = nullptr; mConsumer = nullptr; diff --git a/libs/gui/include/gui/BLASTBufferQueue.h b/libs/gui/include/gui/BLASTBufferQueue.h index 9328a54184..f6bf861b06 100644 --- a/libs/gui/include/gui/BLASTBufferQueue.h +++ b/libs/gui/include/gui/BLASTBufferQueue.h @@ -69,9 +69,7 @@ private: bool mPreviouslyConnected GUARDED_BY(mMutex); }; -class BLASTBufferQueue - : public ConsumerBase::FrameAvailableListener, public BufferItemConsumer::BufferFreedListener -{ +class BLASTBufferQueue : public ConsumerBase::FrameAvailableListener { public: BLASTBufferQueue(const std::string& name, bool updateDestinationFrame = true); BLASTBufferQueue(const std::string& name, const sp<SurfaceControl>& surface, int width, @@ -83,7 +81,6 @@ public: sp<Surface> getSurface(bool includeSurfaceControlHandle); bool isSameSurfaceControl(const sp<SurfaceControl>& surfaceControl) const; - void onBufferFreed(const wp<GraphicBuffer>&/* graphicBuffer*/) override { /* TODO */ } void onFrameReplaced(const BufferItem& item) override; void onFrameAvailable(const BufferItem& item) override; void onFrameDequeued(const uint64_t) override; |