From 6615defd4b8ae627e7f0bbb2382c4d86481f76bd Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Wed, 7 Jul 2010 08:20:49 -0700 Subject: Make sure the OMX callback thread is properly shutdown after the node goes away. Change-Id: Ib0b25855b0dfc191e5529193b4cb519f644a8412 --- media/libstagefright/omx/OMX.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'media/libstagefright/omx') diff --git a/media/libstagefright/omx/OMX.cpp b/media/libstagefright/omx/OMX.cpp index ad5b0f9..6de761f 100644 --- a/media/libstagefright/omx/OMX.cpp +++ b/media/libstagefright/omx/OMX.cpp @@ -164,6 +164,10 @@ void OMX::binderDied(const wp &the_late_who) { instance = mLiveNodes.editValueAt(index); mLiveNodes.removeItemsAt(index); + index = mDispatchers.indexOfKey(instance->nodeID()); + CHECK(index >= 0); + mDispatchers.removeItemsAt(index); + invalidateNodeID_l(instance->nodeID()); } @@ -240,6 +244,11 @@ status_t OMX::freeNode(node_id node) { ssize_t index = mLiveNodes.indexOfKey(instance->observer()->asBinder()); CHECK(index >= 0); mLiveNodes.removeItemsAt(index); + + index = mDispatchers.indexOfKey(node); + CHECK(index >= 0); + mDispatchers.removeItemsAt(index); + instance->observer()->asBinder()->unlinkToDeath(this); return instance->freeNode(mMaster); -- cgit v1.1