зеркало из https://github.com/mozilla/gecko-dev.git
Bug 941701 - Fix crash in TextTrackCue::GetCueAsHTML r=rillian
TextTrackCue::GetCueAsHTML gets called when the HTMLMediaElement shutsdown which means that TextTrackCue's mDocument sometimes no longer exists based on when the cycle collector freed it. I've added a null check to make sure that it exists before we start doing anything.
This commit is contained in:
Родитель
6ece642af0
Коммит
3daf27dc4e
|
@ -79,8 +79,8 @@ TextTrackCue::TextTrackCue(nsISupports* aGlobal,
|
|||
}
|
||||
}
|
||||
|
||||
/** Save a reference to our creating document so it's available
|
||||
* even when unlinked during discard/teardown.
|
||||
/** Save a reference to our creating document so we don't have to
|
||||
* keep getting it from our window.
|
||||
*/
|
||||
nsresult
|
||||
TextTrackCue::StashDocument(nsISupports* aGlobal)
|
||||
|
@ -99,7 +99,11 @@ TextTrackCue::StashDocument(nsISupports* aGlobal)
|
|||
already_AddRefed<DocumentFragment>
|
||||
TextTrackCue::GetCueAsHTML()
|
||||
{
|
||||
MOZ_ASSERT(mDocument);
|
||||
// mDocument may be null during cycle collector shutdown.
|
||||
// See bug 941701.
|
||||
if (!mDocument) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!sParserWrapper) {
|
||||
nsresult rv;
|
||||
|
|
Загрузка…
Ссылка в новой задаче