[MediaStream] Protect MediaDevicesRequest during callback
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 11 Dec 2016 22:08:05 +0000 (22:08 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 11 Dec 2016 22:08:05 +0000 (22:08 +0000)
commit4f597ed92b2a9744956fcef848919d79011d9873
tree16df631652217d8b71ee310b9746413f42b134f3
parent95b50132a5ec5112a61d9ea5325c93efa2e188f5
[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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/MediaDevicesEnumerationRequest.cpp