diff --git a/src/Application.cpp b/src/Application.cpp index 0a2f8b4de..c1d87af0c 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -109,6 +109,7 @@ Application::Application(Settings &_settings, Paths &_paths) , emotes(&this->emplace()) , accounts(&this->emplace()) , hotkeys(&this->emplace()) + , twitch(&this->emplace()) , windows(&this->emplace()) , toasts(&this->emplace()) , imageUploader(&this->emplace()) @@ -117,7 +118,6 @@ Application::Application(Settings &_settings, Paths &_paths) , commands(&this->emplace()) , notifications(&this->emplace()) , highlights(&this->emplace()) - , twitch(&this->emplace()) , chatterinoBadges(&this->emplace()) , ffzBadges(&this->emplace()) , seventvBadges(&this->emplace()) diff --git a/src/Application.hpp b/src/Application.hpp index 5dec1e906..063043618 100644 --- a/src/Application.hpp +++ b/src/Application.hpp @@ -98,6 +98,7 @@ public: Emotes *const emotes{}; AccountController *const accounts{}; HotkeyController *const hotkeys{}; + TwitchIrcServer *const twitch{}; WindowManager *const windows{}; Toasts *const toasts{}; ImageUploader *const imageUploader{}; @@ -106,7 +107,6 @@ public: CommandController *const commands{}; NotificationController *const notifications{}; HighlightController *const highlights{}; - TwitchIrcServer *const twitch{}; ChatterinoBadges *const chatterinoBadges{}; FfzBadges *const ffzBadges{}; SeventvBadges *const seventvBadges{}; diff --git a/src/singletons/WindowManager.cpp b/src/singletons/WindowManager.cpp index a86fdbc5a..1484e980a 100644 --- a/src/singletons/WindowManager.cpp +++ b/src/singletons/WindowManager.cpp @@ -127,7 +127,16 @@ WindowManager::WindowManager() }); } -WindowManager::~WindowManager() = default; +WindowManager::~WindowManager() +{ + for (const auto &window : this->windows_) + { + // We would prefer to use window->deleteLater() here, but the timings are too tight + // Channel's completion model gets destroyed before the deleteLater call actually deletes the + // UI objects that rely on the completion model + delete window; + } +} MessageElementFlags WindowManager::getWordFlags() {