Skip to content

[Cherry-pick] DYN-10383: Fix SplashScreen close re-entrancy crash in LaunchDynamo#17041

Merged
jasonstratton merged 2 commits intoDynamoDS:RC4.1.0_masterfrom
jasonstratton:cherry-pick/DYN-10383-splashscreen-reentrancy-RC4.1
Apr 10, 2026
Merged

[Cherry-pick] DYN-10383: Fix SplashScreen close re-entrancy crash in LaunchDynamo#17041
jasonstratton merged 2 commits intoDynamoDS:RC4.1.0_masterfrom
jasonstratton:cherry-pick/DYN-10383-splashscreen-reentrancy-RC4.1

Conversation

@jasonstratton
Copy link
Copy Markdown
Contributor

@jasonstratton jasonstratton commented Apr 10, 2026

Purpose

Cherry-pick of #17038 to RC4.1.0_master.
DYN-10383 - Fix SplashScreen close re-entrancy crash in LaunchDynamo

Fix a re-entrancy crash in SplashScreen.LaunchDynamo where calling Close() synchronously inside a WebView2 JS-to-.NET callback triggers webView.Dispose() while still on the WebView2 call stack. This manifests as a native process termination (0xC000041D) under the Visual Studio debugger.

Changes:

  • Move dynamoView?.Show() / Activate() before the close to ensure WPF always has a visible window, preventing ShutdownMode.OnLastWindowClose races.
  • Replace synchronous Close() with Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, () => Close()) to defer teardown until the WebView2 callback has fully unwound.

Declarations

Check these if you believe they are true

Release Notes

Fix a splash screen crash caused by re-entrancy when closing the splash window during a WebView2 callback, by deferring the close until the dispatcher is idle.

Reviewers

@QilongTang

FYIs

N/A

jasonstratton and others added 2 commits April 10, 2026 10:48
Defer Close() via Dispatcher.BeginInvoke to avoid disposing WebView2
while still inside a JS-to-.NET callback. Show DynamoView before
closing the splash to prevent ShutdownMode.OnLastWindowClose races.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code review feedback: replace explicit delegate with idiomatic lambda.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Cherry-picks a fix into RC4.1.0_master to prevent a SplashScreen re-entrancy crash when LaunchDynamo is invoked from a WebView2 JS-to-.NET callback, by ensuring the splash teardown does not occur on the WebView2 callback stack.

Changes:

  • Reorders dynamoView?.Show() / Activate() to occur before initiating splash close, reducing WPF shutdown-mode race risk.
  • Defers Close() via Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, ...) to avoid disposing WebView2 while still inside its callback.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-10383

@jasonstratton jasonstratton merged commit ac8275f into DynamoDS:RC4.1.0_master Apr 10, 2026
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants