From 5a65e30064dc8dffa4f3d868f1c46038972c40c5 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Tue, 24 May 2011 15:15:42 -0700 Subject: Make sure all references to the decoder plugin are accounted for before calling dlunload(). Change-Id: I59aa1d19edf566b8a86a6f73b1c2eeb47c96b0de related-to-bug: 4466387 --- media/libstagefright/omx/SimpleSoftOMXComponent.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'media/libstagefright/omx/SimpleSoftOMXComponent.cpp') diff --git a/media/libstagefright/omx/SimpleSoftOMXComponent.cpp b/media/libstagefright/omx/SimpleSoftOMXComponent.cpp index 179b2a0..f7330f3 100644 --- a/media/libstagefright/omx/SimpleSoftOMXComponent.cpp +++ b/media/libstagefright/omx/SimpleSoftOMXComponent.cpp @@ -45,7 +45,11 @@ SimpleSoftOMXComponent::SimpleSoftOMXComponent( PRIORITY_AUDIO); } -SimpleSoftOMXComponent::~SimpleSoftOMXComponent() { +void SimpleSoftOMXComponent::prepareForDestruction() { + // The looper's queue may still contain messages referencing this + // object. Make sure those are flushed before returning so that + // a subsequent dlunload() does not pull out the rug from under us. + mLooper->unregisterHandler(mHandler->id()); mLooper->stop(); } -- cgit v1.1