summaryrefslogtreecommitdiff
path: root/src/index.js
diff options
context:
space:
mode:
authorArjun Satarkar <me@arjunsatarkar.net>2024-10-31 19:32:05 +0000
committerArjun Satarkar <me@arjunsatarkar.net>2024-10-31 19:32:05 +0000
commitdf192c6bfe28fd00132c23d89e4f03d64d78a6e7 (patch)
treeb135ef3c0eff18af147c62ae3796e53be6f34f0f /src/index.js
parent246b42b63ac4803ad48ac81df52c674e98206c0e (diff)
downloadthrow_simulation-df192c6bfe28fd00132c23d89e4f03d64d78a6e7.tar
throw_simulation-df192c6bfe28fd00132c23d89e4f03d64d78a6e7.tar.gz
throw_simulation-df192c6bfe28fd00132c23d89e4f03d64d78a6e7.zip
Avoid leaking the event queue
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/index.js b/src/index.js
index 21d2af9..059ba68 100644
--- a/src/index.js
+++ b/src/index.js
@@ -119,6 +119,8 @@ RAPIER.init().then(() => {
objElement.style.width = `${objSize.x}px`;
objElement.style.height = `${objSize.y}px`;
+ eventQueue.free();
+
setTimeout(mainLoop, STEP_MS);
};