SwiftPasscodeLock icon indicating copy to clipboard operation
SwiftPasscodeLock copied to clipboard

crash when set password

Open foolbear opened this issue 7 years ago • 2 comments

Simultaneous accesses to 0x1c02f2248, but modification requires exclusive access. Previous access (a modification) started at PasscodeLock`PasscodeLock.addSign(:) + 912 (0x1059637bc). Current access (a modification) started at: 0 libswiftCore.dylib 0x0000000105cf1358 swift_beginAccess + 468 1 PasscodeLock 0x0000000105963b7c PasscodeLock.changeStateTo(:) + 168 2 PasscodeLock 0x00000001059649d8 protocol witness for PasscodeLockType.changeStateTo(:) in conformance PasscodeLock + 64 3 PasscodeLock 0x000000010594bc20 SetPasscodeState.acceptPasscode(:fromLock:) + 516 4 PasscodeLock 0x000000010594c304 protocol witness for PasscodeLockStateType.acceptPasscode(:fromLock:) in conformance SetPasscodeState + 196 5 PasscodeLock 0x000000010596342c PasscodeLock.addSign(:) + 1060 6 PasscodeLock 0x0000000105964910 protocol witness for PasscodeLockType.addSign(:) in conformance PasscodeLock + 92 7 PasscodeLock 0x000000010595de54 PasscodeLockViewController.passcodeSignButtonTap(:) + 216 8 PasscodeLock 0x000000010595df54 @objc PasscodeLockViewController.passcodeSignButtonTap(_:) + 72

foolbear avatar Nov 14 '17 04:11 foolbear

I had the same issue. This can be resolved by an async dispatch onto the main queue in PasscodeLock.swift:

open func changeStateTo(_ state: PasscodeLockStateType) {
  DispatchQueue.main.async { [weak self] in
    guard let strongSelf = self else { return }
    strongSelf.lockState = state
    strongSelf.delegate?.passcodeLockDidChangeState(strongSelf)
  }
}

ricobeck avatar Dec 04 '17 17:12 ricobeck

@ricobeck thanks for quick solution!

KanybekMomukeyev avatar Dec 11 '17 15:12 KanybekMomukeyev