diff options
author | Mathias Agopian <mathias@google.com> | 2011-06-15 19:20:52 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2011-06-15 19:31:04 -0700 |
commit | af6edba59e250adbdfa5b3c3be134f70d8c38a16 (patch) | |
tree | 755773c8989097f0880ec9f134861c91527573de /services/surfaceflinger | |
parent | f409604122f959653fb789e9133e94a51e369693 (diff) | |
download | frameworks_base-af6edba59e250adbdfa5b3c3be134f70d8c38a16.zip frameworks_base-af6edba59e250adbdfa5b3c3be134f70d8c38a16.tar.gz frameworks_base-af6edba59e250adbdfa5b3c3be134f70d8c38a16.tar.bz2 |
revert surfaceflinger leak fix as it uncovered a crasher on xoom
Bug: 4600244
Change-Id: Ia68ebf0f243a051ff6a21b3863e3e5d259bbf7ac
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r-- | services/surfaceflinger/Layer.cpp | 5 | ||||
-rw-r--r-- | services/surfaceflinger/Layer.h | 3 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 28 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.h | 6 |
4 files changed, 1 insertions, 41 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index a35811d..731d82b 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -61,7 +61,6 @@ Layer::Layer(SurfaceFlinger* flinger, mBufferManager(mTextureManager), mWidth(0), mHeight(0), mNeedsScaling(false), mFixedSize(false) { - setDestroyer(this); } Layer::~Layer() @@ -78,10 +77,6 @@ Layer::~Layer() } } -void Layer::destroy(RefBase const* base) { - mFlinger->destroyLayer(static_cast<LayerBase const*>(base)); -} - status_t Layer::setToken(const sp<UserClient>& userClient, SharedClient* sharedClient, int32_t token) { diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h index 5330c08..4c92278 100644 --- a/services/surfaceflinger/Layer.h +++ b/services/surfaceflinger/Layer.h @@ -44,7 +44,7 @@ class UserClient; // --------------------------------------------------------------------------- -class Layer : public LayerBaseClient, private RefBase::Destroyer +class Layer : public LayerBaseClient { public: Layer(SurfaceFlinger* flinger, DisplayID display, @@ -92,7 +92,6 @@ public: return mFreezeLock; } protected: - virtual void destroy(RefBase const* base); virtual void dump(String8& result, char* scratch, size_t size) const; private: diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index a7b5857..33cb9a4 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -387,9 +387,6 @@ bool SurfaceFlinger::threadLoop() { waitForEvent(); - // call Layer's destructor - handleDestroyLayers(); - // check for transactions if (UNLIKELY(mConsoleSignals)) { handleConsoleEvents(); @@ -583,31 +580,6 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags) commitTransaction(); } -void SurfaceFlinger::destroyLayer(LayerBase const* layer) -{ - Mutex::Autolock _l(mDestroyedLayerLock); - mDestroyedLayers.add(layer); - signalEvent(); -} - -void SurfaceFlinger::handleDestroyLayers() -{ - Vector<LayerBase const *> destroyedLayers; - - { // scope for the lock - Mutex::Autolock _l(mDestroyedLayerLock); - destroyedLayers = mDestroyedLayers; - mDestroyedLayers.clear(); - } - - // call destructors without a lock held - const size_t count = destroyedLayers.size(); - for (size_t i=0 ; i<count ; i++) { - //LOGD("destroying %s", destroyedLayers[i]->getName().string()); - delete destroyedLayers[i]; - } -} - sp<FreezeLock> SurfaceFlinger::getFreezeLock() const { return new FreezeLock(const_cast<SurfaceFlinger *>(this)); diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h index f81b074..31c20d7 100644 --- a/services/surfaceflinger/SurfaceFlinger.h +++ b/services/surfaceflinger/SurfaceFlinger.h @@ -233,7 +233,6 @@ public: status_t addLayer(const sp<LayerBase>& layer); status_t invalidateLayerVisibility(const sp<LayerBase>& layer); void invalidateHwcGeometry(); - void destroyLayer(LayerBase const* layer); sp<Layer> getLayer(const sp<ISurface>& sur) const; @@ -307,7 +306,6 @@ private: void handleConsoleEvents(); void handleTransaction(uint32_t transactionFlags); void handleTransactionLocked(uint32_t transactionFlags); - void handleDestroyLayers(); void computeVisibleRegions( LayerVector& currentLayers, @@ -430,10 +428,6 @@ private: mutable Barrier mReadyToRunBarrier; - // protected by mDestroyedLayerLock; - mutable Mutex mDestroyedLayerLock; - Vector<LayerBase const *> mDestroyedLayers; - // atomic variables enum { eConsoleReleased = 1, |