remove memory leak

This commit is contained in:
Magnus Ulimoen 2019-07-19 21:42:05 +02:00
parent 9714088a38
commit 4b5b13452b
2 changed files with 3 additions and 1 deletions

View File

@ -5,7 +5,7 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="generator" content="by-hand" /> <meta name="generator" content="by-hand" />
<meta name="viewpost" context="width=device-width, inital-scale=1.0, user-scalable=yes" /> <meta name="viewpost" context="width=device-width, inital-scale=1.0, user-scalable=yes" />
<title>WebGL test</title> <title>WebGL waves</title>
</head> </head>
<body> <body>
<canvas id="glCanvas"></canvas> <canvas id="glCanvas"></canvas>

View File

@ -160,6 +160,8 @@ async function run() {
const vertexCount = 4; const vertexCount = 4;
gl.drawArrays(gl.TRIANGLE_STRIP, offset, vertexCount); gl.drawArrays(gl.TRIANGLE_STRIP, offset, vertexCount);
drawable.free();
window.requestAnimationFrame(drawMe); window.requestAnimationFrame(drawMe);
} }