From 8ecfa780ebc4c8927b2cfcdd77ffd19fb8441d97 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Sun, 12 Jul 2026 17:00:30 +0200 Subject: [PATCH] viewer: drop the cached pixel mask when switching HTTP source cached_pixel_mask is keyed only on arm_date and was cleared only in Close(); ReadURL() reused it, so switching to a source whose start message has an empty or duplicate arm_date silently kept the previous source's mask (wrong pixels masked in the live preview and fed to spot-finding / azimuthal integration). Clear it in ReadURL() too, as Close() does. Co-Authored-By: Claude Opus 4.8 (1M context) --- viewer/JFJochHttpReader.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/viewer/JFJochHttpReader.cpp b/viewer/JFJochHttpReader.cpp index 67d671e4..4385297d 100644 --- a/viewer/JFJochHttpReader.cpp +++ b/viewer/JFJochHttpReader.cpp @@ -298,6 +298,10 @@ std::shared_ptr JFJochHttpReader::UpdateDataset_i() { void JFJochHttpReader::ReadURL(const std::string &url) { std::unique_lock ul(http_mutex); ResetConnection(); // selecting an address (re)opens the connection from scratch + // Drop the previous source's cached mask: a different (or re-armed) source has its own mask, and + // the arm_date key alone does not distinguish an empty/duplicate arm_date across sources. + cached_pixel_mask.reset(); + cached_pixel_mask_arm_date.clear(); addr = url; if (url.empty()) SetStartMessage({});