Don't leak
This commit is contained in:
parent
4a6a25a081
commit
54cbaf3a12
2 changed files with 10 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { ReadonlyVec2 } from 'gl-matrix';
|
||||
import { DefaultFrameBuffer } from '../../graphics-library/frame-buffer/default-frame-buffer';
|
||||
import { tryEnableExtension } from '../../graphics-library/helper/enable-extension';
|
||||
import { ParallelCompiler } from '../../graphics-library/parallel-compiler';
|
||||
import { FragmentShaderOnlyProgram } from '../../graphics-library/program/fragment-shader-only-program';
|
||||
import { getUniversalRenderingContext } from '../../graphics-library/universal-rendering-context';
|
||||
|
|
@ -48,5 +49,12 @@ export const renderNoise = async (
|
|||
frameBuffer.destroy();
|
||||
program.destroy();
|
||||
|
||||
return canvas;
|
||||
const result = document.createElement('canvas');
|
||||
result.width = canvas.width;
|
||||
result.height = canvas.height;
|
||||
result.getContext('2d')!.drawImage(canvas, 0, 0);
|
||||
|
||||
tryEnableExtension(gl, 'WEBGL_lose_context')?.loseContext();
|
||||
|
||||
return result;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -194,6 +194,7 @@ export class RendererImplementation implements Renderer {
|
|||
private setTextures(v: { [textureName: string]: TexImageSource | TextureWithOptions }) {
|
||||
this.textures.forEach((t) => t.destroy());
|
||||
this.textures = [];
|
||||
this.uniformsProvider.textures = {};
|
||||
|
||||
let id = 3;
|
||||
for (const key in v) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue