diff options
author | Ben Chan <benchan@chromium.org> | 2017-06-23 09:11:05 -0700 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-06-23 22:32:07 +0200 |
commit | 2327ebddf1828911830edf1d3d1b98b04256a341 (patch) | |
tree | 626d6186a0bdb39897e43bb0b1490f7c113210d6 | |
parent | 8ad785925a778ddd595337ae012b58bd387f7a7e (diff) |
libmm-glib: use g_list_copy_deep for deep copying a GList
-rw-r--r-- | libmm-glib/mm-modem-messaging.c | 3 | ||||
-rw-r--r-- | libmm-glib/mm-modem-voice.c | 3 | ||||
-rw-r--r-- | libmm-glib/mm-modem.c | 3 |
3 files changed, 3 insertions, 6 deletions
diff --git a/libmm-glib/mm-modem-messaging.c b/libmm-glib/mm-modem-messaging.c index d732dd88..bcc85728 100644 --- a/libmm-glib/mm-modem-messaging.c +++ b/libmm-glib/mm-modem-messaging.c @@ -273,8 +273,7 @@ mm_modem_messaging_list_finish (MMModemMessaging *self, /* The list we got, including the objects within, is owned by the async result; * so we'll make sure we return a new list */ - g_list_foreach (list, (GFunc)g_object_ref, NULL); - return g_list_copy (list); + return g_list_copy_deep (list, (GCopyFunc)g_object_ref, NULL); } static void create_next_sms (ListSmsContext *ctx); diff --git a/libmm-glib/mm-modem-voice.c b/libmm-glib/mm-modem-voice.c index 76cd7b6d..db3d329d 100644 --- a/libmm-glib/mm-modem-voice.c +++ b/libmm-glib/mm-modem-voice.c @@ -138,8 +138,7 @@ mm_modem_voice_list_calls_finish (MMModemVoice *self, /* The list we got, including the objects within, is owned by the async result; * so we'll make sure we return a new list */ - g_list_foreach (list, (GFunc)g_object_ref, NULL); - return g_list_copy (list); + return g_list_copy_deep (list, (GCopyFunc)g_object_ref, NULL); } static void create_next_call (ListCallsContext *ctx); diff --git a/libmm-glib/mm-modem.c b/libmm-glib/mm-modem.c index 6a29853e..9bbd978b 100644 --- a/libmm-glib/mm-modem.c +++ b/libmm-glib/mm-modem.c @@ -1806,8 +1806,7 @@ mm_modem_list_bearers_finish (MMModem *self, /* The list we got, including the objects within, is owned by the async result; * so we'll make sure we return a new list */ - g_list_foreach (list, (GFunc)g_object_ref, NULL); - return g_list_copy (list); + return g_list_copy_deep (list, (GCopyFunc)g_object_ref, NULL); } static void create_next_bearer (ListBearersContext *ctx); |