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:
parent
578b601cc1
commit
57643b2ca6
1 changed files with 6 additions and 0 deletions
|
|
@ -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 (_) {}
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue