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>
This commit is contained in:
Florian Müllner 2022-08-31 12:51:54 +02:00 committed by Marge Bot
parent 582c63c96d
commit 66ae4c7ff3

View File

@ -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;