diff --git a/src/frontend/src/components/RetroEngineComponent.tsx b/src/frontend/src/components/RetroEngineComponent.tsx index 9814f80f..13a8b0b5 100644 --- a/src/frontend/src/components/RetroEngineComponent.tsx +++ b/src/frontend/src/components/RetroEngineComponent.tsx @@ -40,7 +40,7 @@ const RetroEngineComponent: React.FC = () => { } }; - // Initial setup for fullscreen canvas + // Initial setup for full size canvas updateCanvasSize(); // Set up ResizeObserver to adjust canvas size to the size of the container div @@ -83,6 +83,7 @@ const RetroEngineComponent: React.FC = () => { // Deinitialize engine if it has been initialized engineInstance?.deinitialize(); + engineInstance?.delete(); }; }, []);