Open jdiekhoff opened 5 years ago
Thanks @jdiekhoff, the StackBlitz example is a great help. I think we need to capture the handler ids of the events we're attaching to the Bing markers and remove/detach them within every marker's DeleteMarker
call.
See the JavaScript example in the Microsoft's docs here:
//Attach an event
var handlerId = Microsoft.Maps.Events.addHandler(target, 'eventName', handler);
//Remove an event
Microsoft.Maps.Events.removeHandler(handlerId);
My initial hunch is that these event handlers are not being detached and are not allowing the old markers from being garbage collected.
@METACEO : Are you on the hook for a pull request?
I'm using this library to show live changes to marker pins. I've re-created the issue using the bing basic map from stackblitz. This sample updates the marker list every 3 seconds:
StackBlitz
You can see the effects running the profiler. It appears that previous markers are not being released appropriately.