diff --git a/Directory.Build.props b/Directory.Build.props index f06e988..e075473 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -5,7 +5,7 @@ scripts/build-installer.ps1 both read it from here, so releasing is a reviewed change to this line rather than an edit in a pipeline variable group. --> - 1.0.2 + 1.0.3 latest enable enable diff --git a/TODO.md b/TODO.md index 73f6a34..ef85410 100644 --- a/TODO.md +++ b/TODO.md @@ -16,7 +16,7 @@ The delivery chain works end to end: a merge to `main` builds, signs, and publis pre-release to GitHub Releases, and one approval promotes that same build to a release. reads its download links from the release manifest deployed beside it and needs no edit per release. The current product version is `VersionPrefix` in `Directory.Build.props` -(1.0.2). Identity version for the Store package is `VersionPrefix.0` (`1.0.2.0`). +(1.0.3). Identity version for the Store package is `VersionPrefix.0` (`1.0.3.0`). Declaring that number is decision 20 in [docs/decisions.md](docs/decisions.md). What 1.0 was waiting on shipped during 0.9.x: Preferences, `.wimport`, Explorer and VS Code diff --git a/src/SQLBI.Whiteboard/LiveView/LiveViewCaptureSession.cs b/src/SQLBI.Whiteboard/LiveView/LiveViewCaptureSession.cs index e609f7b..91fd980 100644 --- a/src/SQLBI.Whiteboard/LiveView/LiveViewCaptureSession.cs +++ b/src/SQLBI.Whiteboard/LiveView/LiveViewCaptureSession.cs @@ -455,18 +455,21 @@ private void ReleaseCaptureItem() _captureItem = null; } + /// + /// Borrows the frame's DXGI texture. Reference counting here is the whole + /// point: GetRef hands out one owned reference, and + /// ComObject.As takes ownership of the pointer it is given — its + /// temporary wrapper Releases it, including when the QueryInterface throws. + /// Those two pair exactly. Releasing inspectable again dropped the + /// frame pool's recycled surface by one reference on every presented frame, + /// and the finalizer that later Released the freed pointer is the + /// AccessViolationException that closes the app. + /// private static ID3D11Texture2D GetTexture(IDirect3DSurface surface) { nint inspectable = ((IWinRTObject)surface).NativeObject.GetRef(); - try - { - using IDirect3DDxgiInterfaceAccess access = ComObject.As(inspectable); - return access.GetInterface(); - } - finally - { - Marshal.Release(inspectable); - } + using IDirect3DDxgiInterfaceAccess access = ComObject.As(inspectable); + return access.GetInterface(); } private static WinRtDirect3DDevice CreateWinRtDevice(IDXGIDevice dxgiDevice)