-
Notifications
You must be signed in to change notification settings - Fork 1.3k
MGLMapView fails to bind EAGLDrawable when initialised with CGRect with no width and height #1572
Comments
Via #1654, |
|
Per the comments in #5457, the crash has returned. However, I’m unable to reproduce it on either a simulator or a device. |
We’re still unable to reproduce the crash, yet we do get reports about it in the wild. The fix would likely involve changes to mbgl, which we aren’t willing to take this close to a release. Punting to 3.4.0. |
@1ec5 completely unrelated to MGLMapView itself: we have an SDK that inits a WKWebView with CGRectMake(0, 0, 0, 0) and also rarely crashes in the wild (crash reports of only two 6S Plus). We've also had this issue in the past, the workaround was to init the UIWebView we had with 1px height and width, however that workaround is not an option for us anymore with the WKWebView and other changes we've made to the SDK. Now this issue has popped back up on the 27th and 28th of June. We can artificially "reproduce" the crash by putting NAN in the CGRectMake somewhere, which will crash the app and print the following error:
However reproducing it artificially doesn't help as we have no clue why it is NAN in the first place when we literally use: CGRectMake(0, 0, 0, 0) (or CGRectZero) without any calculations. Let me know if this helps you and if you find out anything |
Lots of debugging background yesterday in #6883, which we've closed in favor of the core problem here. |
As per #8562, using a zeroed |
Reopening: it’s very common for a UIView or NSView to be initialized with zero size and given a size at some point before or after being added to the view hierarchy. This crash is a gotcha for many developers. |
@brunoabinader proposes that MGLMapView always create |
#8562 ended up implementing the 64x64-point workaround described above, which should address this crash and console spew. |
Initialising a
MGLMapView
with CGRectZero:Crashes:
Current workaround
The text was updated successfully, but these errors were encountered: