@@ -105,7 +105,6 @@ internal enum Trigger
105105 readonly IUIFactory factory ;
106106 readonly IUIProvider uiProvider ;
107107 readonly IRepositoryHosts hosts ;
108- [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Microsoft.Performance" , "CA1823:AvoidUnusedPrivateFields" ) ]
109108 readonly IConnectionManager connectionManager ;
110109
111110 readonly CompositeDisposable disposables = new CompositeDisposable ( ) ;
@@ -333,7 +332,8 @@ void ConfigureUIHandlingStates()
333332 . OnEntryFrom ( triggers [ Trigger . PRDetail ] , ( arg , tr ) => RunView ( UIViewType . PRDetail , CalculateDirection ( tr ) , arg ) )
334333 . PermitDynamic ( Trigger . Next , ( ) => Go ( Trigger . Next ) )
335334 . PermitDynamic ( Trigger . Cancel , ( ) => Go ( Trigger . Cancel ) )
336- . PermitDynamic ( Trigger . Finish , ( ) => Go ( Trigger . Finish ) ) ;
335+ . PermitDynamic ( Trigger . Finish , ( ) => Go ( Trigger . Finish ) )
336+ . OnExit ( ( ) => DisposeView ( activeFlow , UIViewType . PRDetail ) ) ;
337337
338338 uiStateMachine . Configure ( UIViewType . PRCreation )
339339 . OnEntry ( tr => RunView ( UIViewType . PRCreation , CalculateDirection ( tr ) ) )
@@ -622,6 +622,17 @@ void DisposeFlow(UIControllerFlow flow)
622622 list . Clear ( ) ;
623623 }
624624
625+ void DisposeView ( UIControllerFlow flow , UIViewType type )
626+ {
627+ var list = GetObjectsForFlow ( flow ) ;
628+ IUIPair uipair = null ;
629+ if ( list . TryGetValue ( type , out uipair ) )
630+ {
631+ list . Remove ( type ) ;
632+ uipair . Dispose ( ) ;
633+ }
634+ }
635+
625636 void RunView ( UIViewType viewType , LoadDirection direction , ViewWithData arg = null )
626637 {
627638 if ( requestedTarget ? . ViewType == viewType )
0 commit comments