mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
29 lines
488 B
Swift
29 lines
488 B
Swift
import Foundation
|
|
|
|
final class EscapeGuard {
|
|
final class Status {
|
|
fileprivate(set) var isDeallocated: Bool = false
|
|
}
|
|
|
|
let status = Status()
|
|
|
|
deinit {
|
|
self.status.isDeallocated = true
|
|
}
|
|
}
|
|
|
|
public final class EscapeNotification: NSObject {
|
|
let deallocated: () -> Void
|
|
|
|
public init(_ deallocated: @escaping () -> Void) {
|
|
self.deallocated = deallocated
|
|
}
|
|
|
|
deinit {
|
|
self.deallocated()
|
|
}
|
|
|
|
public func keep() {
|
|
}
|
|
}
|