diff options
author | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2023-03-21 00:39:45 -0500 |
---|---|---|
committer | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2023-03-21 00:39:45 -0500 |
commit | 1b4f76976e1a069831b98518588f587be79b122c (patch) | |
tree | 0558873858c1d4b3fb27069c4932d729e3a7f397 /libpurple/mediamanager.c | |
parent | ae674f38b973f59afa38f5fbcb8b4c069188e59f (diff) | |
download | pidgin-1b4f76976e1a069831b98518588f587be79b122c.tar.gz |
Use g_clear_* helpers where useful
That is:
* when the variable is set to `NULL` right after freeing
* when the variable is checked for non-`NULL` before freeing
* when the variable is a global (because they should be set to `NULL`, even if we don't really claim that things can be re-init'd)
Testing Done:
Compiled, and ran tests in valgrind.
Reviewed at https://reviews.imfreedom.org/r/2369/
Diffstat (limited to 'libpurple/mediamanager.c')
-rw-r--r-- | libpurple/mediamanager.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libpurple/mediamanager.c b/libpurple/mediamanager.c index a4adb4184a..1b5613cc2e 100644 --- a/libpurple/mediamanager.c +++ b/libpurple/mediamanager.c @@ -201,10 +201,8 @@ purple_media_manager_finalize (GObject *media) g_list_free_full(priv->private_medias, g_object_unref); g_list_free_full(priv->elements, g_object_unref); g_clear_pointer(&priv->video_caps, gst_caps_unref); - if (priv->appdata_info) { - g_list_free_full(priv->appdata_info, - (GDestroyNotify)free_appdata_info_locked); - } + g_clear_list(&priv->appdata_info, + (GDestroyNotify)free_appdata_info_locked); g_mutex_clear (&priv->appdata_mutex); if (priv->device_monitor) { gst_device_monitor_stop(priv->device_monitor); |