fix: assert for GUI thread in getters instead of get(I)App (#5102)

This commit is contained in:
nerix
2024-01-18 20:50:57 +01:00
committed by GitHub
parent 6fed9dc42a
commit 4f2ca3b174
3 changed files with 50 additions and 5 deletions
+15 -4
View File
@@ -305,26 +305,35 @@ int Application::run(QApplication &qtApp)
IEmotes *Application::getEmotes()
{
assertInGuiThread();
return this->emotes;
}
IUserDataController *Application::getUserData()
{
assertInGuiThread();
return this->userData;
}
ISoundController *Application::getSound()
{
assertInGuiThread();
return this->sound;
}
ITwitchLiveController *Application::getTwitchLiveController()
{
assertInGuiThread();
return this->twitchLiveController;
}
TwitchBadges *Application::getTwitchBadges()
{
assertInGuiThread();
assert(this->twitchBadges);
return this->twitchBadges.get();
@@ -332,16 +341,22 @@ TwitchBadges *Application::getTwitchBadges()
ITwitchIrcServer *Application::getTwitch()
{
assertInGuiThread();
return this->twitch;
}
PubSub *Application::getTwitchPubSub()
{
assertInGuiThread();
return this->twitchPubSub.get();
}
Logging *Application::getChatLogger()
{
assertInGuiThread();
return this->logging.get();
}
@@ -884,8 +899,6 @@ Application *getApp()
{
assert(Application::instance != nullptr);
assertInGuiThread();
return Application::instance;
}
@@ -893,8 +906,6 @@ IApplication *getIApp()
{
assert(IApplication::instance != nullptr);
assertInGuiThread();
return IApplication::instance;
}