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

Changeset 239889 in webkit


Ignore:
Timestamp:
Jan 11, 2019, 5:22:58 PM (8 years ago)
Author:
jer.noble@apple.com
Message:

REGRESSION(r239419): Crash in AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC()
​https://bugs.webkit.org/show_bug.cgi?id=193342
<rdar://problem/47119836>

Reviewed by Eric Carlson.

Make the TapStorage used by AudioSourceProviderAVFObjC thread-safe RefCounted.

  • platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
  • platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:

(WebCore::AudioSourceProviderAVFObjC::initCallback):
(WebCore::AudioSourceProviderAVFObjC::finalizeCallback):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r239888 r239889  
     12019-01-11  Jer Noble  <jer.noble@apple.com>
     2
     3        REGRESSION(r239419): Crash in AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC()
     4        https://bugs.webkit.org/show_bug.cgi?id=193342
     5        <rdar://problem/47119836>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Make the TapStorage used by AudioSourceProviderAVFObjC thread-safe RefCounted.
     10
     11        * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
     12        * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
     13        (WebCore::AudioSourceProviderAVFObjC::initCallback):
     14        (WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
     15
    1162019-01-11  John Wilander  <wilander@apple.com>
    217
  • trunk/Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h

    r217878 r239889  
    9999    AudioSourceProviderClient* m_client { nullptr };
    100100
    101     struct TapStorage;
    102     TapStorage* m_tapStorage { nullptr };
     101    class TapStorage;
     102    RefPtr<TapStorage> m_tapStorage;
    103103};
    104104   
  • trunk/Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm

    r239458 r239889  
    7070static const double kRingBufferDuration = 1;
    7171
    72 struct AudioSourceProviderAVFObjC::TapStorage {
     72class AudioSourceProviderAVFObjC::TapStorage : public ThreadSafeRefCounted<AudioSourceProviderAVFObjC::TapStorage> {
     73public:
    7374    TapStorage(AudioSourceProviderAVFObjC* _this) : _this(_this) { }
    7475    AudioSourceProviderAVFObjC* _this;
    … …  
    239240    AudioSourceProviderAVFObjC* _this = static_cast<AudioSourceProviderAVFObjC*>(clientInfo);
    240241    _this->m_tap = adoptCF(tap);
    241     _this->m_tapStorage = new TapStorage(_this);
     242    _this->m_tapStorage = adoptRef(new TapStorage(_this));
    242243    _this->init(clientInfo, tapStorageOut);
    243     *tapStorageOut = _this->m_tapStorage;
     244    *tapStorageOut = _this->m_tapStorage.get();
     245
     246    // ref balanced by deref in finalizeCallback:
     247    _this->m_tapStorage->ref();
    244248}
    245249
    … …  
    254258            tapStorage->_this->finalize();
    255259    }
    256     delete tapStorage;
     260    tapStorage->deref();
    257261}
    258262
Note: See TracChangeset for help on using the changeset viewer.