Repository navigation
Conversation
20038c1 to
0788343
Compare
|
cc/ @kkaefer |
|
For reference this PR is somewhat stale, now that some changes have landed in master. I'll be updating shortly, but the gist of the PR is still valid. |
0788343 to
70603dc
Compare
|
Noting here that an intermediate PR (#14439) has landed on master and on |
|
@julianrex I have a displayLink crash like the other reported here. we might open a new issue with the stack trace, but I wanted to give some details as this PR is working on the renderer and I think the issue is not only in background. I get the same crash when I pop from the stack the view controller that is displaying the map. So my controller gets destroyed, and the updateDisplayLink is called to the mapView that is actually already gone. |
|
@racer1988 thanks for this insight! This PR is currently undergoing some refactoring due to recent changes in core, and we'll make sure to consider this scenario. What version of the SDK are you currently on? It would be interesting to know if you still see issues with a more recent SDK if that's applicable. |
|
Currently on EDIT: This issue is very easily reproducible in a simulator. My supposition for that is that the renderer on the device is using the GPU so it's fast. |
|
This pull request has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
|
This pull request has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
We have a number of crashes that appear to be related to rendering in the background: #13821, #13824, #13825 - which is counter to Apple's recommendations.
Looking at this comment from 13821, it was determined that it's possible to put the app into a state where
MGLMapViewisn't dormant and GL rendering can occur. (This is probably in situations where the map view is created programmatically, or some other view controller is affecting the view hierarchy when backgrounding).PR #14156 introduces
mbgl::Renderer::flush()which allows us to ensureglFinish()is called when going into the background as recommended.This PR adds:
MGLApplicationprotocol to aid with mocking.-glkView:drawInRect:Changes:
UIApplicationWillResignActiveNotification- this needs some discussion as this is a change in behavior.TODO?
validateDisplayLink- because of the situation above, it's possible to have a nil or non-nil display link when entering the background. I propose that we should only pause/unpause the display link - and perhaps be more explicit.cc @tmpsantos @chloekraw