From aa7630af7103acd3db7b11cbe08c7d7e186f27c2 Mon Sep 17 00:00:00 2001 From: pajlada Date: Sat, 10 May 2025 14:22:19 +0200 Subject: [PATCH] fix: crash that could occur when force-closing 7tv/bttv live updates (#6197) --- CHANGELOG.md | 1 + src/providers/liveupdates/BasicPubSubManager.hpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0277e2a7..8bb73c30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - Bugfix: Fixed message contents being cleared when using the close button for replies. (#6145) - Bugfix: Fixed the emote popup erroneously logging messages to the `Other` directory. (#6165) - Bugfix: Handle CMD + BACKSPACE behavior explicitly in main chat dialog input for macOS. (#6111) +- Bugfix: Fixed an on-shutdown-crash that could occur when we didn't wait long enough for 7TV/BetterTTV live update connections to close. (#6197) - Bugfix: Fixed a small typo in the settings page. (#6134) - Bugfix: Fixed blocked users showing up in "Users joined:" and "Users parted:" messages. (#6181) - Bugfix: Fixed an issue where Splits could get lost by dragging it onto your Recycle Bin. (#6147) diff --git a/src/providers/liveupdates/BasicPubSubManager.hpp b/src/providers/liveupdates/BasicPubSubManager.hpp index 063cabc8..401e6faf 100644 --- a/src/providers/liveupdates/BasicPubSubManager.hpp +++ b/src/providers/liveupdates/BasicPubSubManager.hpp @@ -402,23 +402,23 @@ private: return false; } + std::vector pendingSubscriptions_; + std::atomic addingClient_{false}; + ExponentialBackoff<5> connectBackoff_{std::chrono::milliseconds(1000)}; + + liveupdates::WebsocketClient websocketClient_; + std::unique_ptr mainThread_; + OnceFlag stoppedFlag_; + std::map>, std::owner_less> clients_; - std::vector pendingSubscriptions_; - std::atomic addingClient_{false}; - ExponentialBackoff<5> connectBackoff_{std::chrono::milliseconds(1000)}; - std::shared_ptr> work_{nullptr}; - liveupdates::WebsocketClient websocketClient_; - std::unique_ptr mainThread_; - OnceFlag stoppedFlag_; - const QString host_; /// Short name of the service (e.g. "7TV" or "BTTV")