Skip to content

Commit 3e3b298

Browse files
authored
Merge pull request #1372 from emutavchi/wpe-2.38-fix-ref-deref-sting
Fix race in ref/deref of StringImpl for some cases
2 parents 5729f3c + 960d3fd commit 3e3b298

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceTrackGStreamer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class MediaSourceTrackGStreamer final: public ThreadSafeRefCounted<MediaSourceTr
4545
virtual ~MediaSourceTrackGStreamer();
4646

4747
TrackPrivateBaseGStreamer::TrackType type() const { return m_type; }
48-
AtomString trackId() const { return m_trackId; }
48+
const AtomString& trackId() const { return m_trackId; }
4949
GRefPtr<GstCaps>& initialCaps() { return m_initialCaps; }
5050
DataMutex<TrackQueue>& queueDataMutex() { return m_queueDataMutex; }
5151

Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,12 @@ void SourceBufferPrivateGStreamer::notifyClientWhenReadyForMoreSamples(const Ato
185185
ASSERT(isMainThread());
186186
ASSERT(m_tracks.contains(trackId));
187187
MediaSourceTrackGStreamer* track = m_tracks.get(trackId);
188-
track->notifyWhenReadyForMoreSamples([weakPtr = WeakPtr { *this }, this, trackId]() mutable {
189-
RunLoop::main().dispatch([weakPtr = WTFMove(weakPtr), this, trackId]() {
188+
track->notifyWhenReadyForMoreSamples([weakPtr = WeakPtr { *this }, this, trackId = trackId.string().isolatedCopy()]() mutable {
189+
RunLoop::main().dispatch([weakPtr = WTFMove(weakPtr), this, trackId = WTFMove(trackId)]() {
190190
if (!weakPtr)
191191
return;
192192
if (!m_hasBeenRemovedFromMediaSource)
193-
provideMediaData(trackId);
193+
provideMediaData(AtomString{ trackId });
194194
});
195195
});
196196
}

Source/WebCore/platform/graphics/nicosia/NicosiaAnimation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ Animation::Animation(const String& name, const KeyframeValueList& keyframes, con
184184
}
185185

186186
Animation::Animation(const Animation& other)
187-
: m_name(other.m_name.isSafeToSendToAnotherThread() ? other.m_name : other.m_name.isolatedCopy())
187+
: m_name(other.m_name.isolatedCopy())
188188
, m_keyframes(other.m_keyframes)
189189
, m_boxSize(other.m_boxSize)
190190
, m_timingFunction(other.m_timingFunction->clone())
@@ -202,7 +202,7 @@ Animation::Animation(const Animation& other)
202202

203203
Animation& Animation::operator=(const Animation& other)
204204
{
205-
m_name = other.m_name.isSafeToSendToAnotherThread() ? other.m_name : other.m_name.isolatedCopy();
205+
m_name = other.m_name.isolatedCopy();
206206
m_keyframes = other.m_keyframes;
207207
m_boxSize = other.m_boxSize;
208208
m_timingFunction = other.m_timingFunction->clone();

0 commit comments

Comments
 (0)