summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-10-18 15:17:07 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-18 15:17:07 -0700
commit8b5161c2aed8637de9bffb1d81298d60ea237caf (patch)
tree709424e226b58566db7669cdac016899acac77c8
parent6018745fb7d61f456f3fd96e79d03de28cd40a07 (diff)
parentd68cda472a3646966a203338ccac04f0783293b7 (diff)
downloadframeworks_base-8b5161c2aed8637de9bffb1d81298d60ea237caf.zip
frameworks_base-8b5161c2aed8637de9bffb1d81298d60ea237caf.tar.gz
frameworks_base-8b5161c2aed8637de9bffb1d81298d60ea237caf.tar.bz2
am d68cda47: An attempt to unregister a handler that\'s no longer registered should not cause an assertion.
Merge commit 'd68cda472a3646966a203338ccac04f0783293b7' into gingerbread-plus-aosp * commit 'd68cda472a3646966a203338ccac04f0783293b7': An attempt to unregister a handler that's no longer registered should not cause an assertion.
-rw-r--r--media/libstagefright/foundation/ALooperRoster.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/media/libstagefright/foundation/ALooperRoster.cpp b/media/libstagefright/foundation/ALooperRoster.cpp
index 7683113..8aa1b15 100644
--- a/media/libstagefright/foundation/ALooperRoster.cpp
+++ b/media/libstagefright/foundation/ALooperRoster.cpp
@@ -54,7 +54,10 @@ void ALooperRoster::unregisterHandler(ALooper::handler_id handlerID) {
Mutex::Autolock autoLock(mLock);
ssize_t index = mHandlers.indexOfKey(handlerID);
- CHECK_GE(index, 0);
+
+ if (index < 0) {
+ return;
+ }
const HandlerInfo &info = mHandlers.valueAt(index);
@@ -84,7 +87,8 @@ void ALooperRoster::postMessage(
if (looper == NULL) {
LOGW("failed to post message. "
- "Target handler still registered, but object gone.");
+ "Target handler %d still registered, but object gone.",
+ msg->target());
mHandlers.removeItemsAt(index);
return;
@@ -111,7 +115,8 @@ void ALooperRoster::deliverMessage(const sp<AMessage> &msg) {
if (handler == NULL) {
LOGW("failed to deliver message. "
- "Target handler registered, but object gone.");
+ "Target handler %d registered, but object gone.",
+ msg->target());
mHandlers.removeItemsAt(index);
return;