Skip to content

Commit

Permalink
[MediaStream] Protect MediaDevicesRequest during callback
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=165711
<rdar://problem/28400468>

Reviewed by Sam Weinig.

No new tests, I was unable to create a reproducible test but this fix avoids
an occasional crash in existing tests.

* Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
(WebCore::MediaDevicesEnumerationRequest::start): Take a reference to the object
before calling the controller in case the completion handler is called synchronously.


Canonical link: https://commits.webkit.org/183341@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
eric-carlson committed Dec 11, 2016
1 parent 9a44e6f commit 8ce5a2b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,18 @@
2016-12-11 Eric Carlson <eric.carlson@apple.com>

[MediaStream] Protect MediaDevicesRequest during callback
https://bugs.webkit.org/show_bug.cgi?id=165711
<rdar://problem/28400468>

Reviewed by Sam Weinig.

No new tests, I was unable to create a reproducible test but this fix avoids
an occasional crash in existing tests.

* Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
(WebCore::MediaDevicesEnumerationRequest::start): Take a reference to the object
before calling the controller in case the completion handler is called synchronously.

2016-12-09 Filip Pizlo <fpizlo@apple.com>

The DOM should have an advancing wavefront opaque root barrier
Expand Down
Expand Up @@ -88,6 +88,7 @@ void MediaDevicesEnumerationRequest::start()
if (!controller)
return;

Ref<MediaDevicesEnumerationRequest> protectedThis(*this);
controller->enumerateMediaDevices(*this);
}

Expand Down

0 comments on commit 8ce5a2b

Please sign in to comment.