Merge pull request #684 from mastodon/fix-share-extension-reentry

Fix share extension reentry crash issue
This commit is contained in:
CMK 2022-11-24 18:05:40 +08:00 committed by GitHub
commit c17169bb6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -115,6 +115,10 @@ public class AppContext: ObservableObject {
.store(in: &disposeBag) .store(in: &disposeBag)
} }
deinit {
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
}
} }
extension AppContext { extension AppContext {

View File

@ -21,7 +21,7 @@ final class ShareViewController: UIViewController {
var disposeBag = Set<AnyCancellable>() var disposeBag = Set<AnyCancellable>()
let context = AppContext() let context = AppContext.shared
private(set) lazy var viewModel = ShareViewModel(context: context) private(set) lazy var viewModel = ShareViewModel(context: context)
let publishButton: UIButton = { let publishButton: UIButton = {
@ -64,6 +64,10 @@ final class ShareViewController: UIViewController {
return label return label
}() }()
deinit {
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
}
} }
extension ShareViewController { extension ShareViewController {
@ -325,3 +329,7 @@ extension ShareViewController {
case missingAuthentication case missingAuthentication
} }
} }
extension AppContext {
static let shared = AppContext()
}