Cities with Internet: its verification hooks leave window when the map closes, so it no longer keeps the whole app in memory

This commit is contained in:
Doxa Maps 2026-09-28 19:53:46 +00:00
parent 578b601cc1
commit 57643b2ca6

View file

@ -438,6 +438,12 @@ onBeforeUnmount(() => {
unmounted = true
selectedPin.cleanup()
uiStore?.selectPeopleGroup(null)
// Release the verification hooks (a map/closure left on window pins the whole app after unmount),
// only if they are still THIS map's: a second instance on the page owns its own.
if (typeof window !== 'undefined' && window.__ciMap === mapRef.value) {
delete window.__ciMap
delete window.__ciState
}
try { mapRef.value?.remove() } catch (_) {}
})