Skip to content

Commit

Permalink
Explicitly exit of retired renderers.
Browse files Browse the repository at this point in the history
Before, this was waiting for GC to clean up unused renderers, which
might not happen if renderers were created and destroyed without a major
GC event.  If GC didn't occur, the webgl context wouldn't be released.
This explicitly exits the renderers (and explicitly loses the webgl
context) as soon as the renderer is no longer in use (due to
autosharing).
  • Loading branch information
manthey committed Jun 26, 2019
1 parent 252a594 commit 0d5174a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/webgl/layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ var webgl_layer = function () {
used_canvases.push(canvas);
}
});
/* explicitly exit any renderers we no longer use */
rerender_list.forEach(function (renderer) {
renderer._exit();
});
};

map.geoOn(geo_event.layerAdd, () => map._updateAutoshareRenderers());
Expand Down

0 comments on commit 0d5174a

Please sign in to comment.