Fix Store LiveView crash on resize and bump to 1.0.1 - #69
Merged
Conversation
Store-packaged Graphics Capture RCWs are apartment-bound. Leaving frame.Surface, the capture session, and GraphicsCaptureItem for the GC finalizer called Marshal.Release from GC.RunFinalizers, which is the AccessViolationException that closed the Store app a few seconds after resizing a LiveView. Dispose those WinRT objects on the dispatcher that created them, close pending frames before FramePool.Recreate, and marshal item.Closed back to the UI thread. VersionPrefix moves to 1.0.1 so the Store can take the fix.
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.
Store-packaged Graphics Capture objects are apartment-bound. LiveView left
frame.Surface, the capture session, andGraphicsCaptureItemfor the GC, soIObjectReference.FinalizecalledMarshal.ReleasefromGC.RunFinalizers. That is theAccessViolationException(Event 1026,0xC0000005) that closed the Store app a few seconds after resizing a LiveView. The same bits run unpackaged because those RCWs are free-threaded there.Dispose the WinRT wrappers on the dispatcher that created them, close any pending frame before
FramePool.Recreate(which invalidates native frames), and marshalGraphicsCaptureItem.Closedback to the UI thread.VersionPrefixis 1.0.1 so this can be promoted to the Store. Identity version will be1.0.1.0.Verified locally:
dotnet build Whiteboard.sln -c Releaseis clean, Core smoke tests pass. The Store repro is still the packaged identity, so confirmation is a sideloaded MSIX or the 1.0.1 Store build on a machine that crashed on 1.0.0.