From 3cc89cb4d2488ea1b13bfd50eeb243d1de4b7f33 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 21 Nov 2020 22:52:19 -0500 Subject: [PATCH] Seeks to avoid false assert failures. --- Outputs/ScanTargets/BufferingScanTarget.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Outputs/ScanTargets/BufferingScanTarget.cpp b/Outputs/ScanTargets/BufferingScanTarget.cpp index bd111574a..99333eca1 100644 --- a/Outputs/ScanTargets/BufferingScanTarget.cpp +++ b/Outputs/ScanTargets/BufferingScanTarget.cpp @@ -93,6 +93,9 @@ template void BufferingScanTarget::end_data(size_t actual_le // Acquire the producer lock. std::lock_guard lock_guard(producer_mutex_); + // Record that no further end_data calls are expected. + data_is_allocated_ = false; + // Do nothing if no data write is actually ongoing. if(allocation_has_failed_ || !data_is_allocated_) return; @@ -108,9 +111,6 @@ template void BufferingScanTarget::end_data(size_t actual_le // distance left on the current line, but there's a risk of exactly filling // the final line, in which case this should wrap back to 0. write_pointers_.write_area %= WriteAreaWidth*WriteAreaHeight; - - // Record that no further end_data calls are expected. - data_is_allocated_ = false; } void BufferingScanTarget::end_data(size_t actual_length) {