Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix race in ref/deref of StringImpl for some cases #1372

Open
wants to merge 2 commits into
base: wpe-2.38
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class MediaSourceTrackGStreamer final: public ThreadSafeRefCounted<MediaSourceTr
virtual ~MediaSourceTrackGStreamer();

TrackPrivateBaseGStreamer::TrackType type() const { return m_type; }
AtomString trackId() const { return m_trackId; }
const AtomString& trackId() const { return m_trackId; }
GRefPtr<GstCaps>& initialCaps() { return m_initialCaps; }
DataMutex<TrackQueue>& queueDataMutex() { return m_queueDataMutex; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ void SourceBufferPrivateGStreamer::notifyClientWhenReadyForMoreSamples(const Ato
ASSERT(isMainThread());
ASSERT(m_tracks.contains(trackId));
MediaSourceTrackGStreamer* track = m_tracks.get(trackId);
track->notifyWhenReadyForMoreSamples([weakPtr = WeakPtr { *this }, this, trackId]() mutable {
RunLoop::main().dispatch([weakPtr = WTFMove(weakPtr), this, trackId]() {
track->notifyWhenReadyForMoreSamples([weakPtr = WeakPtr { *this }, this, trackId = trackId.string().isolatedCopy()]() mutable {
RunLoop::main().dispatch([weakPtr = WTFMove(weakPtr), this, trackId = WTFMove(trackId)]() {
if (!weakPtr)
return;
if (!m_hasBeenRemovedFromMediaSource)
provideMediaData(trackId);
provideMediaData(AtomString{ trackId });
});
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Animation::Animation(const String& name, const KeyframeValueList& keyframes, con
}

Animation::Animation(const Animation& other)
: m_name(other.m_name.isSafeToSendToAnotherThread() ? other.m_name : other.m_name.isolatedCopy())
: m_name(other.m_name.isolatedCopy())
, m_keyframes(other.m_keyframes)
, m_boxSize(other.m_boxSize)
, m_timingFunction(other.m_timingFunction->clone())
Expand All @@ -202,7 +202,7 @@ Animation::Animation(const Animation& other)

Animation& Animation::operator=(const Animation& other)
{
m_name = other.m_name.isSafeToSendToAnotherThread() ? other.m_name : other.m_name.isolatedCopy();
m_name = other.m_name.isolatedCopy();
m_keyframes = other.m_keyframes;
m_boxSize = other.m_boxSize;
m_timingFunction = other.m_timingFunction->clone();
Expand Down