Repository navigation
fix(deck.gl-geotiff): free a palette COG's colormap texture - #834
Merged
Merged
Conversation
COGLayer's default pipeline for a palette COG creates a colormap texture that nothing destroyed: not when a new source replaced the pipeline, and not when the layer was removed. The pipeline now has a `destroy`, which COGLayer calls in both cases. Closes #800 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR was written by Claude (Claude Code), not by @kylebarron.
For a palette COG, COGLayer's default pipeline uploads the color map as a texture that every tile shares. Nothing destroyed it: not when a new source replaced the pipeline, and not when the layer was removed. So each palette COG a layer drew leaked one texture: 1 KB for 256 colors, 256 KB for a 16-bit palette. It adds up when MosaicLayer evicts palette items over a session.
inferRenderPipeline, which is internal, now also returnsdestroy. It frees the textures the pipeline shares across tiles, which today is only a palette's colormap.destroyDefaultPipeline. It calls it when a new source replaces the pipeline, and in a newfinalizeStatewhen the layer is removed.Per-tile textures are unchanged:
onTileUnloadstill destroys each tile'stextureandmask.Tests
Two COGLayer tests on the NLCD fixture, a palette COG, with a device that records the textures it creates:
finalizeStatedestroys the colormap texture.Both failed before the fix, with no texture destroyed. The workspace's tests and typecheck pass.
Closes #800
🤖 Written by Claude Code