Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Sources/Nodes/Core/AbstractContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,15 @@ open class _BaseContext: Context { // swiftlint:disable:this type_name
try workerController.withWorkers(ofType: type, perform: perform)
}

#if DEBUG

deinit {
#if DEBUG
if isActive {
assertionFailure("Lifecycle Violation: Expected `AbstractContext` to deactivate before it is deallocated.")
assertionFailure("Lifecycle Violation: Expect `AbstractContext` to deactivate before it is deallocated.")
}
#endif
}

#endif
}

/**
Expand Down
8 changes: 5 additions & 3 deletions Sources/Nodes/Core/AbstractFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,15 @@ open class AbstractFlow<ContextInterfaceType, ViewControllerType>: Flow {
try flowController.withFlows(ofType: type, perform: perform)
}

#if DEBUG

deinit {
#if DEBUG
if _isStarted {
assertionFailure("Lifecycle Violation: Expected `AbstractFlow` to end before it is deallocated.")
assertionFailure("Lifecycle Violation: Expect `AbstractFlow` to end before it is deallocated.")
}
#endif
}

#endif
}

// swiftlint:enable period_spacing
8 changes: 5 additions & 3 deletions Sources/Nodes/Core/AbstractWorker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ open class _BaseWorker: Worker { // swiftlint:disable:this type_name
isWorking = false
}

#if DEBUG

deinit {
#if DEBUG
if isWorking {
assertionFailure("Lifecycle Violation: Expected `AbstractWorker` to stop before it is deallocated.")
assertionFailure("Lifecycle Violation: Expect `AbstractWorker` to stop before it is deallocated.")
}
#endif
}

#endif
}

/**
Expand Down
8 changes: 5 additions & 3 deletions Sources/Nodes/Internal/WorkerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,18 @@ public final class WorkerController {
try workers(ofType: type).forEach(perform)
}

#if DEBUG

deinit {
#if DEBUG
for worker: Worker in workers {
if worker.isWorking {
assertionFailure("""
Lifecycle Violation: Expected `Worker` to stop before `WorkerController` is deallocated.
Lifecycle Violation: Expect `Worker` instance to stop before `WorkerController` is deallocated.
""")
}
LeakDetector.detect(worker)
}
#endif
}

#endif
}