summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
author Mathias Agopian <mathias@google.com> 2011-02-16 15:43:17 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2011-02-16 15:43:17 -0800
commit260a13a95edbe41fb8042b96b8c35a8a65546ec0 (patch)
tree8cbb62974134ccab6bf101832ee5515cd5b6fb1c /services/surfaceflinger/Layer.cpp
parentb5fd7ae4ce28af9217fbd80716466f971bb96d69 (diff)
parent1b0114f5db78c46b1f4c6a83e6d219bbe1e838e4 (diff)
Merge "fix a surface leak in SurfaceFlinger"
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r--services/surfaceflinger/Layer.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index fde8e677dfcf..0f7d6392e496 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -142,7 +142,8 @@ void Layer::onRemoved()
sp<LayerBaseClient::Surface> Layer::createSurface() const
{
- return mSurface;
+ sp<Surface> sur(new SurfaceLayer(mFlinger, const_cast<Layer *>(this)));
+ return sur;
}
status_t Layer::ditch()
@@ -152,9 +153,6 @@ status_t Layer::ditch()
// the layer is not on screen anymore. free as much resources as possible
mFreezeLock.clear();
- // Free our own reference to ISurface
- mSurface.clear();
-
Mutex::Autolock _l(mLock);
mWidth = mHeight = 0;
return NO_ERROR;
@@ -202,7 +200,6 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h,
int layerRedsize = info.getSize(PixelFormatInfo::INDEX_RED);
mNeedsDithering = layerRedsize > displayRedSize;
- mSurface = new SurfaceLayer(mFlinger, this);
return NO_ERROR;
}