Fix crash that could occur when closing a split before its display name was updated (#4731)

This fixes a crash that could occur when closing a split before the
display name had a chance to update

The reason I found this was because the LiveController change I made
updated display names more regularly

Additionally, we now make sure to not send duplicate `displayNameUpdated` signals
upon each request for channels with CJK characters in their display name

* Default-initialize the `actualDisplayName` with the user's login name to not send an initial display name update if the display name is the same casing as the login name
This commit is contained in:
pajlada
2023-07-23 12:11:57 +02:00
committed by GitHub
parent 5c8c05b1af
commit a440f0261a
5 changed files with 22 additions and 5 deletions
+4 -2
View File
@@ -73,7 +73,7 @@ namespace {
TwitchChannel::TwitchChannel(const QString &name)
: Channel(name, Channel::Type::Twitch)
, ChannelChatters(*static_cast<Channel *>(this))
, nameOptions{name, name}
, nameOptions{name, name, name}
, subscriptionUrl_("https://www.twitch.tv/subs/" + name)
, channelUrl_("https://twitch.tv/" + name)
, popoutPlayerUrl_("https://player.twitch.tv/?parent=twitch.tv&channel=" +
@@ -472,7 +472,7 @@ void TwitchChannel::updateStreamTitle(const QString &title)
void TwitchChannel::updateDisplayName(const QString &displayName)
{
if (displayName == this->getDisplayName())
if (displayName == this->nameOptions.actualDisplayName)
{
// Display name has not changed
return;
@@ -480,6 +480,8 @@ void TwitchChannel::updateDisplayName(const QString &displayName)
// Display name has changed
this->nameOptions.actualDisplayName = displayName;
if (QString::compare(displayName, this->getName(), Qt::CaseInsensitive) ==
0)
{