Fix a crash in TwitchChannel::refreshCheerEmotes

If you closed down the split right after the refreshCheerEmotes call was
made, then refreshCheerEmotes used this after it was free'd
This commit is contained in:
Rasmus Karlsson 2020-01-12 10:06:01 +01:00
parent 265bab1ce6
commit 81b79e14b5

View file

@ -744,6 +744,12 @@ void TwitchChannel::refreshCheerEmotes()
NetworkRequest::twitchRequest(url)
.onSuccess([this,
weak = weakOf<Channel>(this)](auto result) -> Outcome {
auto shared = weak.lock();
if (!shared)
{
return Failure;
}
auto cheerEmoteSets = ParseCheermoteSets(result.parseRapidJson());
std::vector<CheerEmoteSet> emoteSets;