From d96fa9e24e0f8518f10b65558ac6b12f9678050f Mon Sep 17 00:00:00 2001 From: rene Date: Fri, 5 Jun 2026 13:16:38 +0200 Subject: [PATCH] Seitenkarten destroy(): GL-Karte beim Seitenwechsel freigeben (WebGL-Kontext-Leak) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit poison/lost/walks/events: destroy() ruft _map.remove() → app.js gibt den WebGL-Kontext beim Navigieren frei. Sonst akkumulieren Kontexte → iOS-Limit (~8) → neue GL-Karten (z.B. Routen-Detail) scheitern → Leaflet-Raster-Fallback. --- VERSION | 2 +- backend/static/index.html | 24 ++++++++++++------------ backend/static/js/app.js | 2 +- backend/static/js/pages/events.js | 4 +++- backend/static/js/pages/lost.js | 4 +++- backend/static/js/pages/poison.js | 5 ++++- backend/static/js/pages/walks.js | 4 +++- backend/static/landing.html | 2 +- backend/static/sw.js | 2 +- 9 files changed, 29 insertions(+), 20 deletions(-) diff --git a/VERSION b/VERSION index 039b4cd..1f168c5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1198 \ No newline at end of file +1199 \ No newline at end of file diff --git a/backend/static/index.html b/backend/static/index.html index 79d8449..f4336fa 100644 --- a/backend/static/index.html +++ b/backend/static/index.html @@ -86,14 +86,14 @@ Ban Yaro - + - - - - - + + + + + @@ -617,11 +617,11 @@ - - - - - + + + + + @@ -631,7 +631,7 @@ - + diff --git a/backend/static/js/app.js b/backend/static/js/app.js index f5a5607..a9d2fe9 100644 --- a/backend/static/js/app.js +++ b/backend/static/js/app.js @@ -3,7 +3,7 @@ Router, State-Management, Navigation, Initialisierung. ============================================================ */ -const APP_VER = '1198'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '1199'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.6.0'; // ← semantische Version, wird bei make release gesetzt window.APP_VER = APP_VER; // global verfügbar für andere Module (z.B. offline-indicator) window.APP_VERSION = APP_VERSION; diff --git a/backend/static/js/pages/events.js b/backend/static/js/pages/events.js index f1a99d2..a7222b4 100644 --- a/backend/static/js/pages/events.js +++ b/backend/static/js/pages/events.js @@ -669,6 +669,8 @@ window.Page_events = (() => { // Notiz-Modal (Custom DOM — kein UI.modal um Konflikte zu vermeiden) // ---------------------------------------------------------- - return { init, refresh, openNew, _openDetail: _showDetail }; + function _destroy() { try { _map && _map.remove(); } catch (e) {} _map = null; _clusterGroup = null; _markers = []; } + + return { init, refresh, openNew, _openDetail: _showDetail, destroy: _destroy }; })(); diff --git a/backend/static/js/pages/lost.js b/backend/static/js/pages/lost.js index cc37969..92769b3 100644 --- a/backend/static/js/pages/lost.js +++ b/backend/static/js/pages/lost.js @@ -807,6 +807,8 @@ function _emptyState(icon, title, text, cta = '') { // ---------------------------------------------------------- // PUBLIC // ---------------------------------------------------------- - return { init, refresh, openNew }; + function _destroy() { try { _map && _map.remove(); } catch (e) {} _map = null; _markers = []; _userMarker = null; } + + return { init, refresh, openNew, destroy: _destroy }; })(); diff --git a/backend/static/js/pages/poison.js b/backend/static/js/pages/poison.js index 026c273..cd9e642 100644 --- a/backend/static/js/pages/poison.js +++ b/backend/static/js/pages/poison.js @@ -654,6 +654,9 @@ window.Page_poison = (() => { // ---------------------------------------------------------- // PUBLIC // ---------------------------------------------------------- - return { init, refresh, openNew, openDetail: _openDetail }; + // GL-Karte beim Seitenwechsel freigeben (sonst leakt der WebGL-Kontext → iOS-Limit). + function _destroy() { try { _map && _map.remove(); } catch (e) {} _map = null; _markers = []; _userMarker = null; } + + return { init, refresh, openNew, openDetail: _openDetail, destroy: _destroy }; })(); diff --git a/backend/static/js/pages/walks.js b/backend/static/js/pages/walks.js index 6dcdd4c..172fc50 100644 --- a/backend/static/js/pages/walks.js +++ b/backend/static/js/pages/walks.js @@ -1396,6 +1396,8 @@ window.Page_walks = (() => { } - return { init, refresh, onDogChange, openNew, openDetail: _openDetail }; + function _destroy() { try { _map && _map.remove(); } catch (e) {} _map = null; _markers = []; } + + return { init, refresh, onDogChange, openNew, openDetail: _openDetail, destroy: _destroy }; })(); diff --git a/backend/static/landing.html b/backend/static/landing.html index 88b7688..3d19ddc 100644 --- a/backend/static/landing.html +++ b/backend/static/landing.html @@ -4,7 +4,7 @@ - + Ban Yaro — Die Hunde-App für Deutschland, Österreich & Schweiz diff --git a/backend/static/sw.js b/backend/static/sw.js index 843a059..04ea831 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -4,7 +4,7 @@ ============================================================ */ // ← EINZIGE Stelle für die Version — STATIC_ASSETS und CACHE_VERSION leiten sich ab -const VER = '1198'; +const VER = '1199'; const CACHE_VERSION = `by-v${VER}`; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten