Skip to content

Commit

Permalink
Fix memory growth when drawing the canvas
Browse files Browse the repository at this point in the history
Bug: #939
  • Loading branch information
cameronwhite committed Nov 8, 2024
1 parent 25436b0 commit 195ad27
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Pinta.Gui.Widgets/Widgets/Canvas/PintaCanvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ private void Draw (Cairo.Context context, int width, int height)
DrawHandles (g, PintaCore.Tools.CurrentTool.Handles);
g.Restore ();
}

// Explicitly dispose the context to avoid memory growth (bug #939).
// This can be the last reference to a temporary surface from the GTK widget.
context.Dispose ();
}

private static void DrawHandles (Cairo.Context cr, IEnumerable<IToolHandle> controls)
Expand Down

0 comments on commit 195ad27

Please sign in to comment.