Fix crash that could occur when closing down the last of a channel when reloading emotes (#4278)

* Fix crash that could occur when a channel is closed

Ensure we copy the QString in case the channel goes out of scope and
we're referring to nothing

* Add changelog entry
This commit is contained in:
pajlada
2022-12-31 14:03:16 +01:00
committed by GitHub
parent 293aa370c5
commit f04c4c7388
2 changed files with 3 additions and 3 deletions
+1 -2
View File
@@ -169,8 +169,7 @@ void BttvEmotes::loadChannel(std::weak_ptr<Channel> channel,
{
NetworkRequest(QString(bttvChannelEmoteApiUrl) + channelId)
.timeout(20000)
.onSuccess([callback = std::move(callback), channel,
&channelDisplayName,
.onSuccess([callback = std::move(callback), channel, channelDisplayName,
manualRefresh](auto result) -> Outcome {
auto pair =
parseChannelEmotes(result.parseJson(), channelDisplayName);