Skip to content

Commit b78c28c

Browse files
committed
Fix disposal
1 parent 8a37a04 commit b78c28c

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

src/three/plugins/images/ImageOverlayPlugin.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,7 @@ export class ImageOverlayPlugin {
431431

432432
dispose() {
433433

434-
const { tileComposer, tiles } = this;
435-
436-
// dispose textures
437-
tileComposer.dispose();
434+
const { tiles } = this;
438435

439436
// dispose of all overlays
440437
const overlays = [ ...this.overlays ];
@@ -1265,7 +1262,7 @@ export class ImageOverlayPlugin {
12651262

12661263
// if the previous layer is present then draw it as an overlay to fill in any gaps while we wait for
12671264
// the next set of textures
1268-
tileComposer.setRenderTarget( target, range );
1265+
tileComposer.setTarget( target, range );
12691266
tileComposer.clear();
12701267

12711268
forEachTileInBounds( range, info.level - 1, tiling, ( tx, ty, tl ) => {
@@ -1302,7 +1299,7 @@ export class ImageOverlayPlugin {
13021299
}
13031300

13041301
// draw the textures
1305-
tileComposer.setRenderTarget( target, range );
1302+
tileComposer.setTarget( target, range );
13061303
tileComposer.clear();
13071304

13081305
forEachTileInBounds( range, info.level, tiling, ( tx, ty, tl ) => {

src/three/plugins/images/overlays/TiledTextureComposer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ export class TiledTextureComposer {
1212
}
1313

1414
// set the target render texture and the range that represents the full span
15-
setRenderTarget( renderTarget, range ) {
15+
setTarget( canvas, range ) {
1616

17-
this.canvas = renderTarget.image;
18-
this.context = renderTarget.image.getContext( '2d' );
17+
this.canvas = canvas.image;
18+
this.context = canvas.image.getContext( '2d' );
1919
this.range = [ ...range ];
2020

2121
}

0 commit comments

Comments
 (0)