pidgin/pidgin

Parents 016690872c6c
Children 13cfb1168f42
Use g_clear_object instead of NULL check and g_object_unref
--- a/pidgin/gtkblist.c Sun Nov 03 20:37:07 2019 +0300
+++ b/pidgin/gtkblist.c Mon Nov 04 01:02:13 2019 +0300
@@ -3063,16 +3063,11 @@
static void
tooltip_data_free(struct tooltip_data *td)
{
- if(td->avatar)
- g_object_unref(td->avatar);
- if(td->status_icon)
- g_object_unref(td->status_icon);
- if(td->protocol_icon)
- g_object_unref(td->protocol_icon);
- if (td->layout)
- g_object_unref(td->layout);
- if (td->name_layout)
- g_object_unref(td->name_layout);
+ g_clear_object(&td->avatar);
+ g_clear_object(&td->status_icon);
+ g_clear_object(&td->protocol_icon);
+ g_clear_object(&td->layout);
+ g_clear_object(&td->name_layout);
g_free(td);
}