@@ -45,6 +45,7 @@ public partial class App : IDisposable, ISingleInstanceApp
45
45
private static Settings _settings ;
46
46
private static MainWindow _mainWindow ;
47
47
private readonly MainViewModel _mainVM ;
48
+ private readonly Internationalization _internationalization ;
48
49
49
50
// To prevent two disposals running at the same time.
50
51
private static readonly object _disposingLock = new ( ) ;
@@ -107,6 +108,7 @@ public App()
107
108
API = Ioc . Default . GetRequiredService < IPublicAPI > ( ) ;
108
109
_settings . Initialize ( ) ;
109
110
_mainVM = Ioc . Default . GetRequiredService < MainViewModel > ( ) ;
111
+ _internationalization = Ioc . Default . GetRequiredService < Internationalization > ( ) ;
110
112
}
111
113
catch ( Exception e )
112
114
{
@@ -193,7 +195,7 @@ await API.StopwatchLogInfoAsync(ClassName, "Startup cost", async () =>
193
195
Win32Helper . EnableWin32DarkMode ( _settings . ColorScheme ) ;
194
196
195
197
// Initialize language before portable clean up since it needs translations
196
- await Ioc . Default . GetRequiredService < Internationalization > ( ) . InitializeLanguageAsync ( ) ;
198
+ await _internationalization . InitializeLanguageAsync ( ) ;
197
199
198
200
Ioc . Default . GetRequiredService < Portable > ( ) . PreStartCleanUpAfterPortabilityUpdate ( ) ;
199
201
@@ -421,6 +423,7 @@ protected virtual void Dispose(bool disposing)
421
423
_mainWindow ? . Dispatcher . Invoke ( _mainWindow . Dispose ) ;
422
424
_mainVM ? . Dispose ( ) ;
423
425
DialogJump . Dispose ( ) ;
426
+ _internationalization . Dispose ( ) ;
424
427
}
425
428
426
429
API . LogInfo ( ClassName , "End Flow Launcher dispose ----------------------------------------------------" ) ;
0 commit comments