App freezes on main thread on iPhone 5c but not on iPhone 6s

做~自己de王妃 提交于 2019-12-06 05:52:18
Mikael

After a day looking into it, I finally found out that it was linked to MKMapView deinit.

Later I found this post about a very similar topic:

WARNING: Output of vertex shader 'v_gradient' not read by fragment shader

According to - the god - @mojuba , who found that the freeze was also related to the deinit phase offered a fix for the DEBUG mode. Because this issue seems to happen only in DEBUG...

I successfully applied his fix to my code as followed:

deinit {
    #if DEBUG
      // Xcode8/iOS10 MKMapView bug workaround
      if let mV = locationPickerView.mapView {
        VControllerB.unusedObjects.append(mV) // addObject:_mapView];
      }
    #endif
  }

NOTE that this produces a memory leak as mapView is never freed and kept within a static array of the VControllerB class.

NOTE 2: I reported the bug in Apple Bug Reporter while using Xcode 8.2.1 in Jan 27.

This is a deadlock. Looks like you use dispatch_sync on main thread. To fix problem - check other threads. In some thread you will find the code that is waiting when dispatched block ends ...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!