From 293aa370c5e91f87a88bb470ec0c68bab61c9f67 Mon Sep 17 00:00:00 2001 From: pajlada Date: Sat, 31 Dec 2022 13:39:28 +0100 Subject: [PATCH] Fix crash that could occur when closing down splits (#4277) * Fix crash that could occur when closing down splits Specifically, if a split was closed after the request for a thumbnail had been made, but before the request had finished, we'd run into a use-after-free issue * Add changelog entry --- CHANGELOG.md | 1 + src/widgets/splits/SplitHeader.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1141d75dd..91a4b8819 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - Bugfix: Fixed text sometimes not pasting properly when image uploader was disabled. (#4246) - Bugfix: Fixed text cursor(caret) not showing in open channel dialog. (#4196) - Bugfix: Fixed tooltip images not appearing if mouse hovered only first pixel. (#4268) +- Bugfix: Fixed crash that could occurr when closing down a split at the wrong time. (#4277) - Dev: Remove protocol from QApplication's Organization Domain (so changed from `https://www.chatterino.com` to `chatterino.com`). (#4256) - Dev: Ignore `WM_SHOWWINDOW` hide events, causing fewer attempted rescales. (#4198) - Dev: Migrated to C++ 20 (#4252, #4257) diff --git a/src/widgets/splits/SplitHeader.cpp b/src/widgets/splits/SplitHeader.cpp index c80ec4414..bf774fa9c 100644 --- a/src/widgets/splits/SplitHeader.cpp +++ b/src/widgets/splits/SplitHeader.cpp @@ -804,6 +804,7 @@ void SplitHeader::updateChannelText() this->lastThumbnail_.elapsed() > THUMBNAIL_MAX_AGE_MS)) { NetworkRequest(url, NetworkRequestType::Get) + .caller(this) .onSuccess([this](auto result) -> Outcome { // NOTE: We do not follow the redirects, so we need to make sure we only treat code 200 as a valid image if (result.status() == 200)