From 4a64a6e32c40c2708208864961844b242568ea17 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Tue, 27 Sep 2011 12:07:15 -0700 Subject: Fix issue 5373658: memory leak in AudioFlinger. Unlink PowerManagerService binder interface death recipient in ThreadBase destructor. Change-Id: Iab06ae9a8a6737bb002b6416a157b0fb50c11ad5 --- services/audioflinger/AudioFlinger.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'services/audioflinger/AudioFlinger.cpp') diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index 88a05b2efcbb..01f5a6f433be 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -985,6 +985,10 @@ AudioFlinger::ThreadBase::~ThreadBase() mNewParameters.clear(); // do not lock the mutex in destructor releaseWakeLock_l(); + if (mPowerManager != 0) { + sp binder = mPowerManager->asBinder(); + binder->unlinkToDeath(mDeathRecipient); + } } void AudioFlinger::ThreadBase::exit() -- cgit v1.2.3-59-g8ed1b