-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS 9 Crash #31
Comments
on iOS 9 the base class Maybe it should be changed like this ? public struct Metadata {
...
// name
let name = String(describing: type)
if name == "Swift._SwiftObject" || name == "NSObject" || name == "_TtCs12_SwiftObject" { return nil }
... |
我也遇到了这个问题,我和同事的环境都是macOS 10.15,同样的代码,我的不会崩溃,而他的就会崩溃。 |
@shaop 你加上name == "_TtCs12_SwiftObject"判断之后是否有效? |
我尝试了一下,确实有效避免了崩溃。 |
@CoderMJLee 是的,可以避免奔溃。 |
@CoderMJLee 并且多线程的时候经常在第 18 行奔溃,是否应该在将锁放在第 18 行前? public static func type(_ type: Any.Type) -> BaseType? {
// get from cache
let key = typeKey(type)
typeLock.lock()
defer { typeLock.unlock() }
if let mt = types[key] { return mt }
.....
// judge after lock
if let mt = types[key] { return mt }
|
SwiftObject.h 这里有表明
目前不太清楚为什么一些低版本的系统上出现了问题 |
@shaop @huhaosanxiong 1.1.1版本已经修复 |
thanks 👍 |
crash at
Thread 1: EXC_BAD_ACCESS (code=1, address=0x100000003) (Type.swift line 47)
use
description.pointee
on iOS 9The text was updated successfully, but these errors were encountered: