1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 13:58:49 +00:00

[DOM] Hold a strong ref to VoiceData in nsSynthVoiceRegistry::RemoveVoice.

This commit is contained in:
Moonchild
2026-05-25 18:56:57 +02:00
committed by roytam1
parent f83e05cf23
commit 2f73a3004b
@@ -325,12 +325,12 @@ nsSynthVoiceRegistry::RemoveVoice(nsISpeechService* aService,
(XRE_IsContentProcess()) ? "child" : "parent"));
bool found = false;
VoiceData* retval = mUriVoiceMap.GetWeak(aUri, &found);
RefPtr<VoiceData> retval = mUriVoiceMap.GetWeak(aUri, &found);
if(NS_WARN_IF(!(found))) {
if(NS_WARN_IF(!found)) {
return NS_ERROR_NOT_AVAILABLE;
}
if(NS_WARN_IF(!(aService == retval->mService))) {
if(NS_WARN_IF(aService != retval->mService)) {
return NS_ERROR_INVALID_ARG;
}