fix: deadlock and use-after-free in tests (#4981)
* fix: use-after-free in settings * refactor: put seventv api into a singleton * chore: add changelog entry * Add warning for when the 7TV load fails
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "providers/seventv/SeventvEmotes.hpp"
|
||||
|
||||
#include "Application.hpp"
|
||||
#include "common/Literals.hpp"
|
||||
#include "common/NetworkResult.hpp"
|
||||
#include "common/QLogging.hpp"
|
||||
@@ -214,7 +215,7 @@ void SeventvEmotes::loadGlobalEmotes()
|
||||
|
||||
qCDebug(chatterinoSeventv) << "Loading 7TV Global Emotes";
|
||||
|
||||
getSeventvAPI().getEmoteSet(
|
||||
getIApp()->getSeventvAPI()->getEmoteSet(
|
||||
u"global"_s,
|
||||
[this](const auto &json) {
|
||||
QJsonArray parsedEmotes = json["emotes"].toArray();
|
||||
@@ -243,7 +244,7 @@ void SeventvEmotes::loadChannelEmotes(
|
||||
qCDebug(chatterinoSeventv)
|
||||
<< "Reloading 7TV Channel Emotes" << channelId << manualRefresh;
|
||||
|
||||
getSeventvAPI().getUserByTwitchID(
|
||||
getIApp()->getSeventvAPI()->getUserByTwitchID(
|
||||
channelId,
|
||||
[callback = std::move(callback), channel, channelId,
|
||||
manualRefresh](const auto &json) {
|
||||
@@ -405,7 +406,7 @@ void SeventvEmotes::getEmoteSet(
|
||||
{
|
||||
qCDebug(chatterinoSeventv) << "Loading 7TV Emote Set" << emoteSetId;
|
||||
|
||||
getSeventvAPI().getEmoteSet(
|
||||
getIApp()->getSeventvAPI()->getEmoteSet(
|
||||
emoteSetId,
|
||||
[callback = std::move(successCallback), emoteSetId](const auto &json) {
|
||||
auto parsedEmotes = json["emotes"].toArray();
|
||||
|
||||
Reference in New Issue
Block a user