我注意到在播放音频时我在iOS上崩溃了。似乎是在Media对象上调用.cleanup()方法时。
我删除了清理调用,但它仍然崩溃,只需要一点时间,我假设它是在运行GC的时候。
代码有点散布,但看起来像:
media = MediaManager.createMedia({path to media}, false);
media.play();
...
media.cleanup();
崩溃时没有堆栈跟踪,但控制台输出如下所示:
<Error>: {app name}(805,0x381b5000) malloc: *** error for object 0x1a122640: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Apr 28 08:53:12 iPod-4 SpringBoard[48] <Warning>: HW kbd: Failed to set (null) as keyboard focus
Apr 28 08:53:12 iPod-4 com.apple.xpc.launchd[1] (UIKitApplication:{app package}[0x5cf8][805]) <Notice>: Service exited due to signal: Abort trap: 6
Apr 28 08:53:12 iPod-4 mediaserverd[43] <Notice>: '' {app package}(pid = 805) setting DiscoveryMode = DiscoveryMode_None, currentDiscoveryMode = DiscoveryMode_None
Apr 28 08:53:12 iPod-4 SpringBoard[48] <Warning>: Application 'UIKitApplication:{app package}[0x5cf8]' crashed.
Apr 28 08:53:12 iPod-4 UserEventAgent[23] <Warning>: 2041398975621: id={app package} pid=805, state=0
Apr 28 08:53:12 iPod-4 ReportCrash[809] <Error>: assertion failed: 13E238: libsystem_trace.dylib + 15927 [2171E90D-32AA-3F60-9692-C2F8E0D4B1A0]: 0x0
Apr 28 08:53:12 iPod-4 Unknown[809] <Error>:
Apr 28 08:53:12 iPod-4 ReportCrash[809] <Warning>: os_activity_diagnostic_for_pid() failed!
Apr 28 08:53:12 iPod-4 ReportCrash[809] <Notice>: Formulating report for corpse[805] {app name}
Apr 28 08:53:13 iPod-4 ReportCrash[809] <Warning>: Saved type '109(109_Handover)' report (1 of max 25) at /var/mobile/Library/Logs/CrashReporter/{app name}-2016-04-28-085313.ips
似乎是在退出控制媒体对象的表单时或者在尝试再次播放声音时(通过在同一路径上创建新的媒体对象)。