From 48d819a1315f7d1b5abfec9d4fd34fb5aed27b1d Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Thu, 10 Sep 2009 19:41:18 -0700 Subject: fix [2112575] stuck on DequeueCondition for a surface that doesn't exist anymore this also fixes part of [2111536] Device is soft rebooted after ending the call through voice dialer --- libs/surfaceflinger/LayerBase.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libs/surfaceflinger/LayerBase.cpp') diff --git a/libs/surfaceflinger/LayerBase.cpp b/libs/surfaceflinger/LayerBase.cpp index 62e41b0f17..1f224884ff 100644 --- a/libs/surfaceflinger/LayerBase.cpp +++ b/libs/surfaceflinger/LayerBase.cpp @@ -642,9 +642,12 @@ int32_t LayerBaseClient::sIdentity = 0; LayerBaseClient::LayerBaseClient(SurfaceFlinger* flinger, DisplayID display, const sp& client, int32_t i) - : LayerBase(flinger, display), client(client), + : LayerBase(flinger, display), lcblk(NULL), client(client), mIndex(i), mIdentity(uint32_t(android_atomic_inc(&sIdentity))) { + lcblk = new SharedBufferServer( + client->ctrlblk, i, NUM_BUFFERS, + mIdentity); } void LayerBaseClient::onFirstRef() @@ -652,8 +655,6 @@ void LayerBaseClient::onFirstRef() sp client(this->client.promote()); if (client != 0) { client->bindLayer(this, mIndex); - // Initialize this layer's identity - client->ctrlblk->setIdentity(mIndex, mIdentity); } } @@ -663,6 +664,7 @@ LayerBaseClient::~LayerBaseClient() if (client != 0) { client->free(mIndex); } + delete lcblk; } int32_t LayerBaseClient::serverIndex() const -- cgit v1.2.3-59-g8ed1b