From 1617f04e88d3fc0609a336726cfb726f07b93778 Mon Sep 17 00:00:00 2001 From: Thomas Bonfort Date: Mon, 15 Nov 2021 12:38:13 +0100 Subject: [PATCH] avoid goroutine leak when creating bigtiff cogs --- cog.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cog.go b/cog.go index 746c96c..8a2fcbe 100644 --- a/cog.go +++ b/cog.go @@ -473,6 +473,11 @@ func (cog *cog) computeImageryOffsets() error { } else { if dataOffset > uint64(^uint32(0)) { //^uint32(0) is max uint32 //rerun with bigtiff support + + //first empty out the tiles channel to avoid a goroutine leak + for range tiles { + //skip + } cog.bigtiff = true return cog.computeImageryOffsets() }