Skip to content

Commit

Permalink
fix a regression with Text object recycling when using the WebGL rend…
Browse files Browse the repository at this point in the history
…erer (follow #1172)
  • Loading branch information
obiot committed Feb 21, 2023
1 parent 5b0701d commit 1f68808
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/text/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ var getContext2d = function (renderer, text) {
destroy() {
if (this.offScreenCanvas === true) {
if (globalRenderer instanceof WebGLRenderer) {
// make sure the right compositor is active
globalRenderer.setCompositor("quad");
globalRenderer.currentCompositor.deleteTexture2D(globalRenderer.currentCompositor.getTexture2D(this.glTextureUnit));
this.glTextureUnit = undefined;
}
Expand Down

0 comments on commit 1f68808

Please sign in to comment.