summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-09-27 12:07:15 -0700
committerEric Laurent <elaurent@google.com>2011-09-27 12:07:15 -0700
commit9d18ec574f5d847a86a21594ac39394ef5b108fc (patch)
tree5c720b5e0835102eeff634fcf6d27f129751c3d1
parent797ab6072402b12721dc226a9ebde3546e7640e9 (diff)
Fix issue 5373658: memory leak in AudioFlinger.
Unlink PowerManagerService binder interface death recipient in ThreadBase destructor. Change-Id: Iab06ae9a8a6737bb002b6416a157b0fb50c11ad5
-rw-r--r--services/audioflinger/AudioFlinger.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 88a05b2e..01f5a6f4 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<IBinder> binder = mPowerManager->asBinder();
+ binder->unlinkToDeath(mDeathRecipient);
+ }
}
void AudioFlinger::ThreadBase::exit()