[Cherry-pick] DYN-10383: Fix SplashScreen close re-entrancy crash in LaunchDynamo#17041
Merged
jasonstratton merged 2 commits intoDynamoDS:RC4.1.0_masterfrom Apr 10, 2026
Conversation
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>
Contributor
There was a problem hiding this comment.
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()viaDispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, ...)to avoid disposing WebView2 while still inside its callback.
|
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-10383
ac8275f
into
DynamoDS:RC4.1.0_master
28 of 29 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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.LaunchDynamowhere callingClose()synchronously inside a WebView2 JS-to-.NET callback triggerswebView.Dispose()while still on the WebView2 call stack. This manifests as a native process termination (0xC000041D) under the Visual Studio debugger.Changes:
dynamoView?.Show()/Activate()before the close to ensure WPF always has a visible window, preventingShutdownMode.OnLastWindowCloseraces.Close()withDispatcher.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