# HG changeset patch # User Jason Maltzen # Date 2018-05-03 05:43:57 # Node ID afd5051b69927ab70afacc952b401e5cca678d84 # Parent 63ce80f17b8cfcc20d47a886cd1c5da42dc35957 Unref and garbage collect after capture to clean up memory and stop crash due to running out of memory. diff --git a/UI/CaptureView.cs b/UI/CaptureView.cs --- a/UI/CaptureView.cs +++ b/UI/CaptureView.cs @@ -257,6 +257,8 @@ namespace DesertPaintLab DesertPaintLab.AppSettings.Get("DebugScreenshot", out debugScreenshot); Gdk.Image rootImage = rootWindow.GetImage(0, 0, screenWidth, screenHeight); screenBuffer.GetFromImage(rootImage, rootImage.Colormap, 0, 0, 0, 0, screenWidth, screenHeight); + rootImage.Unref(); + System.GC.Collect(); // really, clean up now //screenBuffer.GetFromDrawable(rootWindow, // rootWindow.Colormap, 0, 0, 0, 0, screenWidth, screenHeight); int stride = screenBuffer.Rowstride;