summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r--services/surfaceflinger/Layer.cpp5
-rw-r--r--services/surfaceflinger/Layer.h4
2 files changed, 5 insertions, 4 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 1d75a7b..a35811d 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -61,6 +61,7 @@ Layer::Layer(SurfaceFlinger* flinger,
mBufferManager(mTextureManager),
mWidth(0), mHeight(0), mNeedsScaling(false), mFixedSize(false)
{
+ setDestroyer(this);
}
Layer::~Layer()
@@ -77,8 +78,8 @@ Layer::~Layer()
}
}
-void Layer::destroy() const {
- mFlinger->destroyLayer(this);
+void Layer::destroy(RefBase const* base) {
+ mFlinger->destroyLayer(static_cast<LayerBase const*>(base));
}
status_t Layer::setToken(const sp<UserClient>& userClient,
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 278d64e..5330c08 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -44,7 +44,7 @@ class UserClient;
// ---------------------------------------------------------------------------
-class Layer : public LayerBaseClient
+class Layer : public LayerBaseClient, private RefBase::Destroyer
{
public:
Layer(SurfaceFlinger* flinger, DisplayID display,
@@ -92,7 +92,7 @@ public:
return mFreezeLock; }
protected:
- virtual void destroy() const;
+ virtual void destroy(RefBase const* base);
virtual void dump(String8& result, char* scratch, size_t size) const;
private: