Browse Source

Merge pull request #4554 from AvaloniaUI/fixes/gpu-memory-spike-leak

potential fix for gpu texture leak.
release/0.10.0-preview4
danwalmsley 6 years ago
committed by GitHub
parent
commit
1b581cb3d7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      build/SkiaSharp.props
  2. 6
      src/Skia/Avalonia.Skia/Gpu/OpenGl/GlRenderTarget.cs

4
build/SkiaSharp.props

@ -1,6 +1,6 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="SkiaSharp" Version="2.80.1" />
<PackageReference Condition="'$(IncludeLinuxSkia)' == 'true'" Include="SkiaSharp.NativeAssets.Linux" Version="2.80.0" />
<PackageReference Include="SkiaSharp" Version="2.80.2-preview.33" />
<PackageReference Condition="'$(IncludeLinuxSkia)' == 'true'" Include="SkiaSharp.NativeAssets.Linux" Version="2.80.2-preview.33" />
</ItemGroup>
</Project>

6
src/Skia/Avalonia.Skia/Gpu/OpenGl/GlRenderTarget.cs

@ -31,10 +31,11 @@ namespace Avalonia.Skia
public GlGpuSession(GRContext grContext,
GRBackendRenderTarget backendRenderTarget,
SKSurface surface,
SKSurface surface,
IGlPlatformSurfaceRenderingSession glSession)
{
GrContext = grContext;
GrContext.PurgeResources();
_backendRenderTarget = backendRenderTarget;
_surface = surface;
_glSession = glSession;
@ -45,6 +46,7 @@ namespace Avalonia.Skia
_surface.Dispose();
_backendRenderTarget.Dispose();
GrContext.Flush();
GrContext.PurgeResources();
_glSession.Dispose();
}
@ -93,7 +95,7 @@ namespace Avalonia.Skia
}
finally
{
if(!success)
if (!success)
glSession.Dispose();
}
}

Loading…
Cancel
Save