[gnome-shell] shell/screenshot: Plug memory leak



commit 66ae4c7ff33bebdc3ba67149e870c68903e5af10
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Aug 31 12:51:54 2022 +0200

    shell/screenshot: Plug memory leak
    
    grab_screenshot_content() does not follow the usual pattern of
    ```
      task = g_task_new (...);
      g_task_run_in_thread (task, ...);
      g_object_unref (task);
    ```
    
    That means we hold the original reference throughout the operation,
    and must release it ourselves when done.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5501
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2461>

 src/shell-screenshot.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/src/shell-screenshot.c b/src/shell-screenshot.c
index fcf2da2365..f7132eee8e 100644
--- a/src/shell-screenshot.c
+++ b/src/shell-screenshot.c
@@ -308,6 +308,7 @@ grab_screenshot_content (ShellScreenshot *screenshot,
   float scale;
   g_autoptr (GError) error = NULL;
   g_autoptr (ClutterContent) content = NULL;
+  g_autoptr (GTask) task = result;
   MetaCursorTracker *tracker;
   CoglTexture *cursor_texture;
   int cursor_hot_x, cursor_hot_y;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]