Skip to content

Fix Windows texture player lifetime during unregister - #399

Merged
wang-bin merged 1 commit into
wang-bin:masterfrom
JulienDev:fix/windows-texture-lifetime
Sep 17, 2026
Merged

wang-bin merged 1 commit into
wang-bin:masterfrom
JulienDev:fix/windows-texture-lifetime

Conversation

@JulienDev

Copy link
Copy Markdown
Contributor

Summary

  • use the asynchronous UnregisterTexture completion callback on Windows
  • keep TexturePlayer alive until Flutter has removed the texture
  • destroy the wrapper before completing ReleaseRT, so Dart cannot delete the underlying MDK player first

This prevents Flutter's raster thread from entering the GPU surface descriptor callback after the wrapper and its D3D resources have been destroyed.

Fixes #397.

Testing

  • flutter build windows --release in example
  • verified in Windows Release builds of the affected application

@wang-bin
wang-bin merged commit 08c8b14 into wang-bin:master Sep 17, 2026
15 checks passed
@wang-bin

Copy link
Copy Markdown
Owner

lgtm. thanks

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.

[Windows] Crash in GPU texture callback after asynchronous UnregisterTexture

2 participants