mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Fix bug in which teardowns can be called multiple times on the same coordinator
This commit is contained in:
committed by
Stefan Ceriu
parent
0ffbf1603c
commit
9bba378c2d
@@ -229,15 +229,13 @@ class NavigationSplitCoordinator: CoordinatorProtocol, ObservableObject, CustomS
|
|||||||
///
|
///
|
||||||
/// For added complexity, the NavigationSplitCoordinator has an internal compact layout NavigationStack for which we need to manually nil things again
|
/// For added complexity, the NavigationSplitCoordinator has an internal compact layout NavigationStack for which we need to manually nil things again
|
||||||
private func releaseAllCoordinatorReferences() {
|
private func releaseAllCoordinatorReferences() {
|
||||||
sidebarModule?.tearDown()
|
sidebarModule = nil
|
||||||
detailModule?.tearDown()
|
detailModule = nil
|
||||||
sheetModule?.tearDown()
|
sheetModule = nil
|
||||||
fullScreenCoverModule?.tearDown()
|
fullScreenCoverModule = nil
|
||||||
|
|
||||||
compactLayoutRootModule?.tearDown()
|
compactLayoutRootModule = nil
|
||||||
compactLayoutStackModules.forEach { module in
|
compactLayoutStackModules.removeAll()
|
||||||
module.tearDown()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private func logPresentationChange(_ change: String, _ module: NavigationModule) {
|
private func logPresentationChange(_ change: String, _ module: NavigationModule) {
|
||||||
@@ -626,13 +624,10 @@ class NavigationStackCoordinator: ObservableObject, CoordinatorProtocol, CustomS
|
|||||||
/// when a NavigationModule is dismissed. As the NavigationModule is just a wrapper multiple instances of it continuing living is of no consequence
|
/// when a NavigationModule is dismissed. As the NavigationModule is just a wrapper multiple instances of it continuing living is of no consequence
|
||||||
/// https://stackoverflow.com/questions/73885353/found-a-strange-behaviour-of-state-when-combined-to-the-new-navigation-stack/
|
/// https://stackoverflow.com/questions/73885353/found-a-strange-behaviour-of-state-when-combined-to-the-new-navigation-stack/
|
||||||
func stop() {
|
func stop() {
|
||||||
rootModule?.tearDown()
|
rootModule = nil
|
||||||
sheetModule?.tearDown()
|
sheetModule = nil
|
||||||
fullScreenCoverModule?.tearDown()
|
fullScreenCoverModule = nil
|
||||||
|
stackModules.removeAll()
|
||||||
stackModules.forEach { module in
|
|
||||||
module.tearDown()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - CustomStringConvertible
|
// MARK: - CustomStringConvertible
|
||||||
|
|||||||
Reference in New Issue
Block a user