зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1748644
- MIDI ports should stop responding to parent message once they've been disconnected from the document that owned them r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D135700
This commit is contained in:
Родитель
4ea70a7334
Коммит
250cea0582
|
@ -37,7 +37,11 @@ JSObject* MIDIInput::WrapObject(JSContext* aCx,
|
|||
}
|
||||
|
||||
void MIDIInput::Receive(const nsTArray<MIDIMessage>& aMsgs) {
|
||||
nsCOMPtr<Document> doc = GetOwner() ? GetOwner()->GetDoc() : nullptr;
|
||||
if (!GetOwner()) {
|
||||
return; // Ignore messages once we've been disconnected from the owner
|
||||
}
|
||||
|
||||
nsCOMPtr<Document> doc = GetOwner()->GetDoc();
|
||||
if (!doc) {
|
||||
NS_WARNING("No document available to send MIDIMessageEvent to!");
|
||||
return;
|
||||
|
|
|
@ -163,6 +163,10 @@ void MIDIPort::Notify(const void_t& aVoid) {
|
|||
}
|
||||
|
||||
void MIDIPort::FireStateChangeEvent() {
|
||||
if (!GetOwner()) {
|
||||
return; // Ignore changes once we've been disconnected from the owner
|
||||
}
|
||||
|
||||
StateChange();
|
||||
|
||||
MOZ_ASSERT(mPort);
|
||||
|
|
Загрузка…
Ссылка в новой задаче