Repository navigation
fix(layers): drop the deleted texture in IconManager.finalize - #10810
Merged
chrisgervang merged 2 commits intoOct 29, 2026
Merged
Conversation
finalize() deleted the texture but kept the reference. Icons still loading when the layer was finalized resolved afterwards and copied into the deleted texture, logging a WebGL INVALID_OPERATION per icon. The load callback already skips the write when _texture is null, as setProps leaves it when an iconAtlas replaces the packed one.
[Low impact] The PR appears safe to merge. SummaryClears the deleted texture reference in
Reviews (2) · Last reviewed commit: "Merge branch 'master' into fix/icon-mana..." · Reviewed by Greptile |
29 of 30 tasks
chrisgervang
approved these changes
Oct 29, 2026
chrisgervang
added a commit
that referenced
this pull request
Nov 3, 2026
finalize() deleted the texture but kept the reference. Icons still loading when the layer was finalized resolved afterwards and copied into the deleted texture, logging a WebGL INVALID_OPERATION per icon. The load callback already skips the write when _texture is null, as setProps leaves it when an iconAtlas replaces the packed one. Co-authored-by: Chris Gervang <[email protected]> (cherry picked from commit e76e540)
7 tasks
Collaborator
|
Released in deck.gl 9.4.2. Thanks @javandres! |
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.
fix(layers): drop the deleted texture in IconManager.finalize
IconManager.finalize()deletes its texture but keeps the reference to it. Icons still loading whenthe layer is finalized resolve afterwards and run
this._texture?.copyExternalImage(...)against thedeleted texture, so each one logs
WebGL: INVALID_OPERATION: bindTexture: attempt to use a deleted objectand the mipmap regeneration that follows. The load callback already skips the write when_textureisnull, which is how theiconAtlasbranch ofsetPropsleaves it after deleting.In an application that replaces an auto-packing
IconLayerwhile its icons are still downloading wecounted 8 of these warnings per replacement; none with this change.
Change List
IconManager.finalize: set_texturetonullafter deleting itfinalizedoes not write into the deleted textureNote
Low Risk
Narrow lifecycle fix in icon atlas loading with a regression test; no API or security surface change.
Overview
Fixes WebGL
INVALID_OPERATION: bindTexturenoise when an auto-packingIconLayeris torn down while icon fetches are still in flight.IconManager.finalize()already deleted the atlas texture but left_texturepointing at it; late load callbacks still calledcopyExternalImageand mipmap regeneration on that handle. After delete,_textureis set tonull, matching theiconAtlaspath insetProps, so pending loads no-op via the existing optional chaining.Adds a unit test that finalizes with a load pending and asserts the completed load does not write to the deleted texture and
getTexture()is null.Reviewed by Cursor Bugbot for commit 3b28714. Bugbot is set up for automated code reviews on this repo. Configure here.