File tree Expand file tree Collapse file tree
src/DynamoCoreWpf/Views/SplashScreen Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -331,9 +331,16 @@ private void LaunchDynamo(bool isCheckboxChecked)
331331 viewModel . PreferenceSettings . EnableStaticSplashScreen = ! isCheckboxChecked ;
332332 }
333333 currentCloseMode = CloseMode . ByStartingDynamo ;
334- Close ( ) ;
334+
335335 dynamoView ? . Show ( ) ;
336336 dynamoView ? . Activate ( ) ;
337+
338+ // Defer closing the splash screen until the dispatcher is idle.
339+ // This method is invoked from a WebView2 JS-to-.NET callback, so calling Close()
340+ // synchronously can trigger webView.Dispose() while still inside that callback,
341+ // causing re-entrancy crashes. Showing dynamoView first ensures WPF always has a
342+ // visible window, preventing ShutdownMode.OnLastWindowClose from terminating the app.
343+ Dispatcher . BeginInvoke ( System . Windows . Threading . DispatcherPriority . ApplicationIdle , ( ) => Close ( ) ) ;
337344 }
338345
339346 private void OnLoginStateChanged ( LoginState state )
You can’t perform that action at this time.
0 commit comments