Browse Source

release Context (#13788)

* release Context

try fix #13571

* await it

* change
pull/13780/head
Color_yr 2 years ago
committed by GitHub
parent
commit
1f919606b4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/Avalonia.OpenGL/Controls/OpenGlControlResources.cs

6
src/Avalonia.OpenGL/Controls/OpenGlControlResources.cs

@ -16,7 +16,7 @@ internal class OpenGlControlBaseResources : IAsyncDisposable
public CompositionDrawingSurface Surface { get; }
private readonly CompositionOpenGlSwapchain _swapchain;
public IGlContext Context { get; private set; }
public static OpenGlControlBaseResources? TryCreate(CompositionDrawingSurface surface,
ICompositionGpuInterop interop,
IOpenGlTextureSharingRenderInterfaceContextFeature feature)
@ -54,7 +54,7 @@ internal class OpenGlControlBaseResources : IAsyncDisposable
return new OpenGlControlBaseResources(context, surface, interop, null, externalObjects);
}
public OpenGlControlBaseResources(IGlContext context,
private OpenGlControlBaseResources(IGlContext context,
CompositionDrawingSurface surface,
ICompositionGpuInterop interop,
IOpenGlTextureSharingRenderInterfaceContextFeature? feature,
@ -161,7 +161,9 @@ internal class OpenGlControlBaseResources : IAsyncDisposable
}
Surface.Dispose();
await _swapchain.DisposeAsync();
Context.Dispose();
Context = null!;
}

Loading…
Cancel
Save