Change ConsumerBase's FrameAvailableListener to be a weak pointer
This prevents strong reference cycles when the listener implementation also
holds a strong pointer to the ConsumerBase
Bug: 7425644
Change-Id: I1514b13a32b18d421c902dddebec0765a989c55c
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 6f75d8c..54099f4 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -47,7 +47,8 @@
// ---------------------------------------------------------------------------
-class Layer : public LayerBaseClient
+class Layer : public LayerBaseClient,
+ public SurfaceTexture::FrameAvailableListener
{
public:
Layer(SurfaceFlinger* flinger, const sp<Client>& client);
@@ -102,13 +103,15 @@
private:
friend class SurfaceTextureLayer;
- void onFrameQueued();
virtual sp<ISurface> createSurface();
uint32_t getEffectiveUsage(uint32_t usage) const;
bool isCropped() const;
Rect computeBufferCrop() const;
static bool getOpacityForFormat(uint32_t format);
+ // Interface implementation for SurfaceTexture::FrameAvailableListener
+ virtual void onFrameAvailable();
+
// -----------------------------------------------------------------------
// constants