[6fc8f95bc6465849249d974d53eecc56c00ffda0fc3c7024bfa5b8e4d794b072/gnome-3-36] shell/window-tracker: Minor simplification
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [6fc8f95bc6465849249d974d53eecc56c00ffda0fc3c7024bfa5b8e4d794b072/gnome-3-36] shell/window-tracker: Minor simplification
- Date: Tue, 7 Jul 2020 19:11:04 +0000 (UTC)
commit f7dc59e3705db1160c8e948944648a637d0def69
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Jul 3 17:28:45 2020 +0200
shell/window-tracker: Minor simplification
Switching to autocleanup gives us a better separation between the
app/no-app cases.
https://gitlab.gnome.org/GNOME/gnome-shell/issues/219
src/shell-window-tracker.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/shell-window-tracker.c b/src/shell-window-tracker.c
index 075cb2a164..55637da84d 100644
--- a/src/shell-window-tracker.c
+++ b/src/shell-window-tracker.c
@@ -214,7 +214,7 @@ get_app_from_id (MetaWindow *window,
{
ShellApp *app;
ShellAppSystem *appsys;
- char *desktop_file;
+ g_autofree char *desktop_file = NULL;
g_return_val_if_fail (id != NULL, NULL);
@@ -223,10 +223,9 @@ get_app_from_id (MetaWindow *window,
desktop_file = g_strconcat (id, ".desktop", NULL);
app = shell_app_system_lookup_app (appsys, desktop_file);
if (app)
- g_object_ref (app);
+ return g_object_ref (app);
- g_free (desktop_file);
- return app;
+ return NULL;
}
/*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]