mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

Destroy gl buffers after calling Source#reload

Open ansis opened this issue 10 years ago • 4 comments

mapbox-gl-js version: 0.15.0

Steps to Trigger Behavior

  1. map.style.sources[vectorTileSourceName].reload()

Expected Behavior

The GL buffers from the old buckets are destroyed.

Actual Behavior

The GL buffers from the old buckets are not destroyed.

When vector tiles are reloaded, only loadVectorData is called. The existing buckets and their gl buffers are never destroyed https://github.com/mapbox/mapbox-gl-js/blob/2b809ddaf3be1547dd485a2d968f0cc9efbf4fd1/js/source/vector_tile_source.js#L74-L100

ansis avatar Mar 15 '16 00:03 ansis

Any progress on this? We are having issues with Mapbox-gl-js on iOS. Even after completely removing the script, and adding the script back in, we are seeing the error: Terminated due to memory error. After loading mapbox about 5 times.

We've tried everything from using the mapboxgl.remove(), to removing script and reloading dynamically for every map creation.

ryd0rz avatar Jul 29 '16 21:07 ryd0rz

@ansis Have you solved this problem? I also have this problem when call geojson source setData().

wandergis avatar Aug 29 '16 06:08 wandergis

@lucaswoj How to destory the GL buffers from the old buckets? Can you give me some advice? Thanks very much.

wandergis avatar Aug 29 '16 12:08 wandergis

memory memory2

wandergis avatar Aug 29 '16 16:08 wandergis