[Bug 613982] Crash [@ libdvm.so@0x48c42 ] in sa_stream_write when closing a tab playing audio. r=kinetik. a=blocking-fennec

--HG--
extra : rebase_source : 825c83d3e804d9786b09a74e6ba216d03aa6d896
This commit is contained in:
Doug Turner 2010-11-22 14:08:49 -08:00
Родитель 128be0fcdc
Коммит 197e31ddc6
2 изменённых файлов: 9 добавлений и 30 удалений

Просмотреть файл

@ -178,26 +178,6 @@ class AudioInitEvent : public nsRunnable
nsRefPtr<nsAudioStreamRemote> mOwner;
};
class AudioShutdownEvent : public nsRunnable
{
public:
AudioShutdownEvent(nsAudioStreamRemote* owner)
{
mOwner = owner;
}
NS_IMETHOD Run()
{
if (mOwner->mAudioChild) {
PAudioChild::Send__delete__(mOwner->mAudioChild);
mOwner->mAudioChild = nsnull;
}
mOwner = nsnull;
return NS_OK;
}
nsRefPtr<nsAudioStreamRemote> mOwner;
};
class AudioWriteEvent : public nsRunnable
{
public:
@ -353,7 +333,10 @@ nsAudioStreamLocal::nsAudioStreamLocal() :
{
}
nsAudioStreamLocal::~nsAudioStreamLocal(){}
nsAudioStreamLocal::~nsAudioStreamLocal()
{
Shutdown();
}
NS_IMPL_THREADSAFE_ISUPPORTS0(nsAudioStreamLocal)
@ -589,7 +572,9 @@ nsAudioStreamRemote::nsAudioStreamRemote()
{}
nsAudioStreamRemote::~nsAudioStreamRemote()
{}
{
Shutdown();
}
NS_IMPL_THREADSAFE_ISUPPORTS0(nsAudioStreamRemote)
@ -624,8 +609,8 @@ nsAudioStreamRemote::Init(PRInt32 aNumChannels,
void
nsAudioStreamRemote::Shutdown()
{
nsCOMPtr<nsIRunnable> event = new AudioShutdownEvent(this);
NS_DispatchToMainThread(event);
PAudioChild::Send__delete__(mAudioChild);
mAudioChild = nsnull;
}
nsresult

Просмотреть файл

@ -161,12 +161,6 @@ nsBuiltinDecoderStateMachine::nsBuiltinDecoderStateMachine(nsBuiltinDecoder* aDe
nsBuiltinDecoderStateMachine::~nsBuiltinDecoderStateMachine()
{
MOZ_COUNT_DTOR(nsBuiltinDecoderStateMachine);
if (mAudioStream) {
MonitorAutoEnter mon(mDecoder->GetMonitor());
mAudioStream->Shutdown();
mAudioStream = nsnull;
}
}
PRBool nsBuiltinDecoderStateMachine::HasFutureAudio() const {