[MSE][Mac] Crash when reloading a page during playback
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jan 2014 04:59:15 +0000 (04:59 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jan 2014 04:59:15 +0000 (04:59 +0000)
commitc8b8b2093712c08cbbb09c457850c5541d3431d4
tree478de6df78cae430b4f777c3fb02330b4150fcb6
parent31fc964556cdbb7ba9a2766b212cea1c65d33a71
[MSE][Mac] Crash when reloading a page during playback
https://bugs.webkit.org/show_bug.cgi?id=126903

Reviewed by Eric Carlson.

Periodic time observers added to AVSampleBufferRenderSynchronizer will execute their
callback block even after being removed with -removeTimeObserver:, which is tracked by
<rdar://problem/15798050>. Work around this problem by passing a WeakPtr into the block
and bail early if the owning media player has been destroyed.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::createWeakPtr):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm