From 81b79e14b5144126bdc871b8eb6c216766d4ddb1 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sun, 12 Jan 2020 10:06:01 +0100 Subject: [PATCH] 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 --- src/providers/twitch/TwitchChannel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/providers/twitch/TwitchChannel.cpp b/src/providers/twitch/TwitchChannel.cpp index df1582422..d305f0c43 100644 --- a/src/providers/twitch/TwitchChannel.cpp +++ b/src/providers/twitch/TwitchChannel.cpp @@ -744,6 +744,12 @@ void TwitchChannel::refreshCheerEmotes() NetworkRequest::twitchRequest(url) .onSuccess([this, weak = weakOf(this)](auto result) -> Outcome { + auto shared = weak.lock(); + if (!shared) + { + return Failure; + } + auto cheerEmoteSets = ParseCheermoteSets(result.parseRapidJson()); std::vector emoteSets;