From 6952447c0bec3983137c2fc4c358ef9094d19610 Mon Sep 17 00:00:00 2001 From: Jeroen De Dauw Date: Fri, 3 Apr 2026 01:10:13 +0200 Subject: [PATCH] Fix setInterval never cleared in LeafletLoader.js Fixes https://github.com/ProfessionalWiki/Maps/issues/864 After VE activation, `initializeMaps()` runs every second forever via `setInterval`. The `clearInterval` code was commented out, causing intervals to accumulate if VE is opened multiple times. Uncomment the cleanup code. Co-Authored-By: Claude Opus 4.6 (1M context) --- resources/leaflet/LeafletLoader.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/leaflet/LeafletLoader.js b/resources/leaflet/LeafletLoader.js index ab403ffa..c0c787c0 100644 --- a/resources/leaflet/LeafletLoader.js +++ b/resources/leaflet/LeafletLoader.js @@ -32,9 +32,9 @@ window.mapsLeafletList = []; 1000 ); - // mw.hook( 've.deactivationComplete' ).add( function() { - // clearInterval( thread ); - // } ); + mw.hook( 've.deactivationComplete' ).add( function() { + clearInterval( thread ); + } ); // surface.getModel().on( 'history', function() { // console.log('history');