Bug 1325172 - unregister agent when nsNPAPI releases it. r=baku
When the global window detroyed, the service would notify agent's callback to mute its volume. And the nsNSNPAPI's detroy would release the agent, I guess these things would happen in the same time. So we should check whether the agent exists before calling agent's function. MozReview-Commit-ID: 7uNmbdOLqxe
This commit is contained in:
@@ -1797,11 +1797,13 @@ nsNPAPIPluginInstance::WindowVolumeChanged(float aVolume, bool aMuted)
|
||||
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "SetMuted failed");
|
||||
if (mMuted != aMuted) {
|
||||
mMuted = aMuted;
|
||||
AudioChannelService::AudibleState audible = aMuted ?
|
||||
AudioChannelService::AudibleState::eNotAudible :
|
||||
AudioChannelService::AudibleState::eAudible;
|
||||
mAudioChannelAgent->NotifyStartedAudible(audible,
|
||||
AudioChannelService::AudibleChangedReasons::eVolumeChanged);
|
||||
if (mAudioChannelAgent) {
|
||||
AudioChannelService::AudibleState audible = aMuted ?
|
||||
AudioChannelService::AudibleState::eNotAudible :
|
||||
AudioChannelService::AudibleState::eAudible;
|
||||
mAudioChannelAgent->NotifyStartedAudible(audible,
|
||||
AudioChannelService::AudibleChangedReasons::eVolumeChanged);
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user