⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 176476 in webkit


Ignore:
Timestamp:
Nov 21, 2014, 3:29:08 PM (12 years ago)
Author:
jer.noble@apple.com
Message:

[Mac] Random crashes inside media libraries when creating then destroying media quickly.
https://bugs.webkit.org/show_bug.cgi?id=138980

Reviewed by Eric Carlson.

Speculative fix for random crashes in the layout tests which occur randomly but regularly. The theory is
that creating-then-destroying our media objects too quickly triggers crashes deep within the media frameworks
when their initialization threads don't have a chance to complete before the main player object is destroyed.
Test out this theory by delaying the destruction of the AVPlayer object for 1s after its owner is destroyed.

  • platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:

(WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r176475 r176476  
     12014-11-21  Jer Noble  <jer.noble@apple.com>
     2
     3        [Mac] Random crashes inside media libraries when creating then destroying media quickly.
     4        https://bugs.webkit.org/show_bug.cgi?id=138980
     5
     6        Reviewed by Eric Carlson.
     7
     8        Speculative fix for random crashes in the layout tests which occur randomly but regularly. The theory is
     9        that creating-then-destroying our media objects too quickly triggers crashes deep within the media frameworks
     10        when their initialization threads don't have a chance to complete before the main player object is destroyed.
     11        Test out this theory by delaying the destruction of the AVPlayer object for 1s after its owner is destroyed.
     12
     13        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
     14        (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
     15
    1162014-11-21  Jer Noble  <jer.noble@apple.com>
    217
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm

    r176475 r176476  
    497497        [m_avPlayer.get() removeObserver:m_objcObserver.get() forKeyPath:@"externalPlaybackActive"];
    498498#endif
    499         m_avPlayer = nil;
     499       
     500        RetainPtr<AVPlayerType> strongPlayer = WTF::move(m_avPlayer);
     501        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), [strongPlayer] () mutable {
     502            strongPlayer.clear();
     503        });
    500504    }
    501505
Note: See TracChangeset for help on using the changeset viewer.