diff options
Diffstat (limited to 'pidgin')
-rw-r--r-- | pidgin/gtkblist.c | 3 | ||||
-rw-r--r-- | pidgin/gtkrequest.c | 3 | ||||
-rw-r--r-- | pidgin/gtkutils.c | 3 | ||||
-rw-r--r-- | pidgin/gtkxfer.c | 3 | ||||
-rw-r--r-- | pidgin/plugins/disco/xmppdisco.c | 3 | ||||
-rw-r--r-- | pidgin/plugins/gestures/stroke-draw.c | 4 | ||||
-rw-r--r-- | pidgin/plugins/gestures/stroke.c | 10 |
7 files changed, 9 insertions, 20 deletions
diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c index ab4e96ebd8..6b60ee85e1 100644 --- a/pidgin/gtkblist.c +++ b/pidgin/gtkblist.c @@ -322,8 +322,7 @@ rebuild_chat_entries(PidginChatData *data, const char *default_chat_name) child = gtk_widget_get_first_child(GTK_WIDGET(data->rq_data.vbox)); } - g_list_free(data->entries); - data->entries = NULL; + g_clear_list(&data->entries, NULL); if(!PURPLE_IS_PROTOCOL_CHAT(protocol)) { return; diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c index eb6de41f58..7fabbfc9b1 100644 --- a/pidgin/gtkrequest.c +++ b/pidgin/gtkrequest.c @@ -2290,6 +2290,5 @@ void pidgin_request_uninit(void) { purple_signals_disconnect_by_handle(pidgin_request_get_handle()); - g_hash_table_destroy(datasheet_stock); - datasheet_stock = NULL; + g_clear_pointer(&datasheet_stock, g_hash_table_destroy); } diff --git a/pidgin/gtkutils.c b/pidgin/gtkutils.c index ab340f908c..de75a891b6 100644 --- a/pidgin/gtkutils.c +++ b/pidgin/gtkutils.c @@ -657,8 +657,7 @@ gboolean pidgin_auto_parent_window(GtkWidget *widget) break; } } - if (windows) - g_list_free(windows); + g_clear_list(&windows, NULL); if (parent) { gtk_window_set_transient_for(GTK_WINDOW(widget), parent); return TRUE; diff --git a/pidgin/gtkxfer.c b/pidgin/gtkxfer.c index f7a9ad84c8..de9d7dae65 100644 --- a/pidgin/gtkxfer.c +++ b/pidgin/gtkxfer.c @@ -944,8 +944,7 @@ pidgin_xfers_init(void) void pidgin_xfers_uninit(void) { - if (xfer_dialog != NULL) - pidgin_xfer_dialog_destroy(xfer_dialog); + g_clear_pointer(&xfer_dialog, pidgin_xfer_dialog_destroy); } void diff --git a/pidgin/plugins/disco/xmppdisco.c b/pidgin/plugins/disco/xmppdisco.c index 290a19cc0f..b918756672 100644 --- a/pidgin/plugins/disco/xmppdisco.c +++ b/pidgin/plugins/disco/xmppdisco.c @@ -711,8 +711,7 @@ static gboolean xmpp_disco_unload(GPluginPlugin *plugin, G_GNUC_UNUSED gboolean unload, G_GNUC_UNUSED GError **error) { - g_hash_table_destroy(iq_callbacks); - iq_callbacks = NULL; + g_clear_pointer(&iq_callbacks, g_hash_table_destroy); purple_signals_disconnect_by_handle(plugin); pidgin_disco_dialogs_destroy_all(); diff --git a/pidgin/plugins/gestures/stroke-draw.c b/pidgin/plugins/gestures/stroke-draw.c index 2dc27a642f..6aff3ad02a 100644 --- a/pidgin/plugins/gestures/stroke-draw.c +++ b/pidgin/plugins/gestures/stroke-draw.c @@ -319,9 +319,7 @@ gstroke_cleanup (GtkWidget *widget) struct gstroke_metrics *metrics; GHashTable *hash_table = (GHashTable *)g_object_steal_data(G_OBJECT(widget), GSTROKE_SIGNALS); - if (hash_table) { - g_hash_table_destroy(hash_table); - } + g_clear_pointer(&hash_table, g_hash_table_destroy); metrics = (struct gstroke_metrics *)g_object_steal_data(G_OBJECT(widget), GSTROKE_METRICS); diff --git a/pidgin/plugins/gestures/stroke.c b/pidgin/plugins/gestures/stroke.c index 34ef020af3..aa29a04da4 100644 --- a/pidgin/plugins/gestures/stroke.c +++ b/pidgin/plugins/gestures/stroke.c @@ -22,13 +22,9 @@ void -_gstroke_init (struct gstroke_metrics *metrics) -{ - if (metrics->pointList != NULL) { - g_slist_free_full(metrics->pointList, g_free); - metrics->pointList = NULL; - metrics->point_count = 0; - } +_gstroke_init(struct gstroke_metrics *metrics) { + g_clear_slist(&metrics->pointList, g_free); + metrics->point_count = 0; } /* figure out which bin the point falls in */ |