From ba54af0113fe98f03dc69518d885b2321e98da04 Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Mon, 28 Sep 2026 20:27:47 +0000 Subject: [PATCH] A destroyed map's container stops holding it containerRef.__doxaMap was set when the map was created and never cleared, so the dead map (GL context, sources, tiles) stayed reachable from the DOM after destroy(). It is now cleared, only if it is still this instance's. The logo-owner claim is released by the commit before this one. --- library/composables/useMapInstance.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/composables/useMapInstance.js b/library/composables/useMapInstance.js index de637e368..850aeca12 100644 --- a/library/composables/useMapInstance.js +++ b/library/composables/useMapInstance.js @@ -798,7 +798,11 @@ export function useMapInstance({ const w = typeof window !== 'undefined' ? window : null if (w && w.__doxaLogoOwner === map.value) w.__doxaLogoOwner = null } catch (_) { /* a locked-down window is not a reason to skip the teardown below */ } + const dead = map.value map.value.remove() + // The container kept __doxaMap after teardown, holding the whole dead map (GL context, sources, + // tiles) reachable from the DOM. Clear it only if it is still this instance's. + try { if (containerRef && containerRef.value && containerRef.value.__doxaMap === dead) containerRef.value.__doxaMap = null } catch (_) {} map.value = null isMapReady.value = false }