diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-02-01 12:08:38 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-02-01 12:10:05 -0500 |
commit | bf8b974f6806ffde86542e1a8342d2633d56271b (patch) | |
tree | 1e81c40165f61a7d37ee27f6005a29b13311a2d6 | |
parent | 3d85d53e5d2297ebe70c77b646e014ac6641137d (diff) | |
download | gtk+-bf8b974f6806ffde86542e1a8342d2633d56271b.tar.gz |
imcontext: Code cleanup
Use g_clear_pointer instead of opencoding it in
multiple places.
-rw-r--r-- | gtk/gtkimcontextsimple.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c index 76afa8c1ee..093145c307 100644 --- a/gtk/gtkimcontextsimple.c +++ b/gtk/gtkimcontextsimple.c @@ -174,8 +174,7 @@ gtk_im_context_simple_init_compose_table (void) g_free (path); return; } - g_free (path); - path = NULL; + g_clear_pointer (&path, g_free); home = g_get_home_dir (); if (home == NULL) @@ -190,8 +189,7 @@ gtk_im_context_simple_init_compose_table (void) g_free (path); return; } - g_free (path); - path = NULL; + g_clear_pointer (&path, g_free); locale = g_getenv ("LC_CTYPE"); if (locale == NULL) @@ -224,8 +222,7 @@ gtk_im_context_simple_init_compose_table (void) if (g_file_test (path, G_FILE_TEST_EXISTS)) break; - g_free (path); - path = NULL; + g_clear_pointer (&path, g_free); } g_free (x11_compose_file_dir); @@ -237,8 +234,7 @@ gtk_im_context_simple_init_compose_table (void) global_tables = gtk_compose_table_list_add_file (global_tables, path); G_UNLOCK (global_tables); } - g_free (path); - path = NULL; + g_clear_pointer (&path, g_free); } static void |