-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[core] Ensure correct GL context in Map::onLowMemory() #6972
Conversation
@jfirebaugh, thanks for your PR! By analyzing the history of the files in this pull request, we identified @kkaefer, @brunoabinader and @1ec5 to be potential reviewers. |
This probably fixes #1509 as well. |
It most likely doesn't fix #1509. It's a single map with memory under 25 MB the last time I tried. The geometries are literally quads that resselate into two triangles per quad. It doesn't use any symbols etc. The vector tiles are trivial quads literally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great finding, @jfirebaugh - though for future reference, it might be interesting for the Painter
object to receive a reference for the whole Backend
on its ctor instead of just Context
, because Context
can't currently activate itself. We could then have a RAII-based guard on every painter call that handles OpenGL calls, like cleanup()
and reset()
for instance.
FWIW, I tried to trigger this particular code path when I debugged the original issue, but couldn't get it to crash even in severely RAM constrained environments, however, I only used one map so there probably was no GL context conflict. While we're at it: we should also move the call to |
@brunoabinader @kkaefer -- good ideas. Can you work on followup PRs for those? |
This ports changes in #6972 to this version of the map.
Fixes #5731