保留周期会导致崩溃吗,并且会导致EXC_BREAKPOINT崩溃

时间:2018-06-25 09:50:48

标签: swift memory-leaks

我发生了崩溃EXC_BREAKPOINT 0x000000010097e11c

我的领导一直说这是一个参考周期。我不确定参考周期如何导致崩溃,因为它只会导致内存泄漏。

我认为它是一个僵尸对象,是一个对象不存在的内存泄漏。 (https://stackoverflow.com/a/50514660/1898829

它在这样的行上崩溃

if model.object.array.isEmpty, let polyline = model.object.polyline {

模型不能为空

对象被声明为隐式展开的可选

数组不能为零

折线是带有问号(?)的可选声明

我无法重现崩溃,即使打开了僵尸对象,我也无法重现任何东西

这是崩溃日志

Crashed: com.apple.main-thread
0  AppName                         0x10097e11c specialized CusstomGoogleMapView.drawRoute(BaseMapModel) -> () (CusstomGoogleMapView.swift:61)
1  AppName                         0x1009805f4 specialized CusstomGoogleMapView.modelDidChange(model : BaseMapModel) -> () (CusstomGoogleMapView.swift:41)
2  AppName                         0x10097d37c CusstomGoogleMapViewAppNameBaseMapViewModelDelegate (CusstomGoogleMapView.swift)
3  AppName                         0x100944090 CustomViewController.tripOperationFinished() -> () (CustomViewController+Notifications.swift)
4  AppName                         0x100944120 @objc CustomViewController.tripOperationFinished() -> () (CustomViewController+Notifications.swift)
5  CoreFoundation                 0x1822b0c3c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
6  CoreFoundation                 0x1822b01b8 _CFXRegistrationPost + 428
7  CoreFoundation                 0x1822aff14 ___CFXNotificationPost_block_invoke + 216
8  CoreFoundation                 0x18232d84c -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1408
9  CoreFoundation                 0x1821e6f38 _CFXNotificationPost + 384
10 Foundation                     0x182c57bbc -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
11 AppName                         0x10089cbb4 CustomViewModel.confirmTrip() -> () empty-list  empty-list  (CustomViewModel.swift:69)
12 AppName                         0x10089d2a8 CustomViewModel.confirmTrip() -> () empty-list  empty-list  (CustomViewModel.swift)
13 AppName                         0x10092c1ec BaseFlownotifyCompletion empty-list  empty-list  (BaseFlow.swift:26)
14 AppName                         0x10088f0f4 _T0Ieg_IeyB_TR (UINavigationBar +AppName.swift)
15 libdispatch.dylib              0x181c10aa0 _dispatch_call_block_and_release + 24
16 libdispatch.dylib              0x181c10a60 _dispatch_client_callout + 16
17 libdispatch.dylib              0x181c1d65c _dispatch_main_queue_callback_4CF$VARIANT$mp + 1012
18 CoreFoundation                 0x1822c7070 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
19 CoreFoundation                 0x1822c4bc8 __CFRunLoopRun + 2272
20 CoreFoundation                 0x1821e4da8 CFRunLoopRunSpecific + 552
21 GraphicsServices               0x1841c9020 GSEventRunModal + 100
22 UIKit                          0x18c201758 UIApplicationMain + 236
23 AppName                         0x1007ce98c main (AppDelegate.swift:21)
24 libdyld.dylib                  0x181c75fc0 start + 

根据此https://stackoverflow.com/a/42823867/1898829 差额是由

引起的
  

EXC_BREAKPOINT总是通过执行某种陷阱指令(*)来触发的,并且异常直接传递给执行陷阱指令的线程。因此,如果您看到崩溃报告说该堆栈中的该线程获得了EXC_BREAKPOINT,则意味着该线程确实对执行陷阱指令的操作有用。

并且进行谷歌搜索确实会保留周期,导致崩溃迅速不会产生任何好的来源。

我的问题是保留周期会导致崩溃吗,并且会导致EXC_BREAKPOINT崩溃

如果您能告诉我如何解决崩溃问题,奖励积分

0 个答案:

没有答案