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
This commit is contained in:
Florian Müllner 2020-07-03 17:28:45 +02:00
parent d0d91c49b8
commit f7dc59e370

View File

@ -214,7 +214,7 @@ get_app_from_id (MetaWindow *window,
{ {
ShellApp *app; ShellApp *app;
ShellAppSystem *appsys; ShellAppSystem *appsys;
char *desktop_file; g_autofree char *desktop_file = NULL;
g_return_val_if_fail (id != NULL, 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); desktop_file = g_strconcat (id, ".desktop", NULL);
app = shell_app_system_lookup_app (appsys, desktop_file); app = shell_app_system_lookup_app (appsys, desktop_file);
if (app) if (app)
g_object_ref (app); return g_object_ref (app);
g_free (desktop_file); return NULL;
return app;
} }
/* /*