Skip to content

Commit 93d450f

Browse files
Update examples/src/examples/gaussian-splatting/crop.example.mjs (playcanvas#8266)
Signed-off-by: Misfit <218383634+JaclynCodes@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 039772a commit 93d450f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

examples/src/examples/gaussian-splatting/crop.example.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,17 @@ assetListLoader.load(() => {
180180
app.touch.on('touchstart', onUserInteraction);
181181
}
182182

183+
// Clean up event listeners on destroy
184+
app.on('destroy', () => {
185+
if (app.mouse) {
186+
app.mouse.off('mousedown', onUserInteraction);
187+
app.mouse.off('mousewheel', onUserInteraction);
188+
}
189+
if (app.touch) {
190+
app.touch.off('touchstart', onUserInteraction);
191+
}
192+
});
193+
183194
// Animate AABB size with soft bounce
184195
const period = 9.0; // seconds for one cycle
185196
const minSize = 0.4;

0 commit comments

Comments
 (0)