You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 7, 2026. It is now read-only.
I have a question related to "release" method of MediaPlayer and Player class.
In MediaPlayer class, when we call release() we will release Player and set this value to null (mPlayer = null).
In Player class we will send message "MSG_STOP" to EventHandler stop other threads,
But EventHandle will handle "MSG_STOP" in another thread, so have a case a command "mPlayer = null" is run while we are processing "MSG_STOP". When "mPlayer = null" is set I think app will be crashed, because we are referencing to mPlayer in EventHandle.
Could you give your advice about this situation? Or I have misunderstood anything?
In the case it has problem, could I use "sendMessageAndAwaitResponse(nMsg)" instead of "mEventHandler.sendMessageAtFrontOfQueue(nMsg)" in release method of Player?
Hi,
I have a question related to "release" method of MediaPlayer and Player class.
But EventHandle will handle "MSG_STOP" in another thread, so have a case a command "mPlayer = null" is run while we are processing "MSG_STOP". When "mPlayer = null" is set I think app will be crashed, because we are referencing to mPlayer in EventHandle.
Could you give your advice about this situation? Or I have misunderstood anything?
In the case it has problem, could I use "sendMessageAndAwaitResponse(nMsg)" instead of "mEventHandler.sendMessageAtFrontOfQueue(nMsg)" in release method of Player?
Thanks,