diff --git a/Penumbra/Interop/Services/TextureArraySlicer.cs b/Penumbra/Interop/Services/TextureArraySlicer.cs index de493dce..701afb03 100644 --- a/Penumbra/Interop/Services/TextureArraySlicer.cs +++ b/Penumbra/Interop/Services/TextureArraySlicer.cs @@ -17,7 +17,7 @@ public sealed unsafe class TextureArraySlicer : Luna.IUiService, IDisposable /// Caching this across frames will cause a crash to desktop. public ImTextureId GetImGuiHandle(Texture* texture, byte sliceIndex) { - if (texture == null) + if (texture is null) throw new ArgumentNullException(nameof(texture)); if (sliceIndex >= texture->ArraySize) throw new ArgumentOutOfRangeException(nameof(sliceIndex), @@ -73,9 +73,6 @@ public sealed unsafe class TextureArraySlicer : Luna.IUiService, IDisposable { ID3D11ShaderResourceView* slicedSrv = null; Marshal.ThrowExceptionForHR(device->CreateShaderResourceView(resource, &description, &slicedSrv)); - resource->Release(); - device->Release(); - state = new SliceState(slicedSrv); _activeSlices.Add(((nint)texture, sliceIndex), state); return new ImTextureId((nint)state.ShaderResourceView);