summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Andreas Huber <andih@google.com> 2010-10-19 09:55:31 -0700
committer Android Git Automerger <android-git-automerger@android.com> 2010-10-19 09:55:31 -0700
commit9cb1898052c42a82dfd86b54f6328d8fcd29dd57 (patch)
tree8d30c52a25965cd546c33785104d9708ea57f6b2
parent952912fa1d9016ef3a21f9738612fde0f2bf2890 (diff)
parent8b5161c2aed8637de9bffb1d81298d60ea237caf (diff)
am 8b5161c2: am d68cda47: An attempt to unregister a handler that\'s no longer registered should not cause an assertion.
Merge commit '8b5161c2aed8637de9bffb1d81298d60ea237caf' * commit '8b5161c2aed8637de9bffb1d81298d60ea237caf': 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 7683113477ce..8aa1b151fcd5 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;