summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYi-Soo An <yisooan@gmail.com>2018-11-22 12:29:03 +0900
committerErnestas Kulik <ernestask@gnome.org>2018-11-23 14:37:28 +0000
commit0c5948aa174168fdd3454c678663630be09d2f29 (patch)
treed1f4c8883e5b987e64df33c2aa7e1c53f573f433
parent01f58776366b6d4269caa43b8562c8d9e6b5175d (diff)
downloadnautilus-0c5948aa174168fdd3454c678663630be09d2f29.tar.gz
freedesktop-dbus: Use g_autoptr
Use g_autoptr instead of manually freeing resources.
-rw-r--r--src/nautilus-freedesktop-dbus.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/nautilus-freedesktop-dbus.c b/src/nautilus-freedesktop-dbus.c
index 98b02d2de..5cbbbad01 100644
--- a/src/nautilus-freedesktop-dbus.c
+++ b/src/nautilus-freedesktop-dbus.c
@@ -63,8 +63,8 @@ skeleton_handle_show_items_cb (NautilusFreedesktopFileManager1 *object,
for (i = 0; uris[i] != NULL; i++)
{
- GFile *file;
- GFile *parent;
+ g_autoptr (GFile) file = NULL;
+ g_autoptr (GFile) parent = NULL;
file = g_file_new_for_uri (uris[i]);
parent = g_file_get_parent (file);
@@ -72,14 +72,11 @@ skeleton_handle_show_items_cb (NautilusFreedesktopFileManager1 *object,
if (parent != NULL)
{
nautilus_application_open_location (application, parent, file, startup_id);
- g_object_unref (parent);
}
else
{
nautilus_application_open_location (application, file, NULL, startup_id);
}
-
- g_object_unref (file);
}
nautilus_freedesktop_file_manager1_complete_show_items (object, invocation);
@@ -100,13 +97,11 @@ skeleton_handle_show_folders_cb (NautilusFreedesktopFileManager1 *object,
for (i = 0; uris[i] != NULL; i++)
{
- GFile *file;
+ g_autoptr (GFile) file = NULL;
file = g_file_new_for_uri (uris[i]);
nautilus_application_open_location (application, file, NULL, startup_id);
-
- g_object_unref (file);
}
nautilus_freedesktop_file_manager1_complete_show_folders (object, invocation);