diff --git a/daemon/codec.c b/daemon/codec.c index 2c5c0e8d3..24fd850a5 100644 --- a/daemon/codec.c +++ b/daemon/codec.c @@ -1083,19 +1083,18 @@ void __codec_handlers_update(struct call_media *receiver, struct call_media *sin } // first gather info about what we can send - AUTO_CLEANUP_NULL(GHashTable *supplemental_sinks, __g_hash_table_destroy); + g_autoptr(GHashTable) supplemental_sinks = NULL; struct rtp_payload_type *pref_dest_codec = NULL; __check_codec_list(&supplemental_sinks, &pref_dest_codec, sink, &sink->codecs.codec_prefs); // then do the same with what we can receive - AUTO_CLEANUP_NULL(GHashTable *supplemental_recvs, __g_hash_table_destroy); + g_autoptr(GHashTable) supplemental_recvs = NULL; __check_codec_list(&supplemental_recvs, NULL, receiver, &receiver->codecs.codec_prefs); // if multiple input codecs transcode to the same output codec, we want to make sure // that all the decoders output their media to the same encoder. we use the destination // payload type to keep track of this. - AUTO_CLEANUP(GHashTable *output_transcoders, __g_hash_table_destroy) - = g_hash_table_new(g_direct_hash, g_direct_equal); + g_autoptr(GHashTable) output_transcoders = g_hash_table_new(g_direct_hash, g_direct_equal); enum block_dtmf_mode dtmf_block_mode = dtmf_get_block_mode(NULL, monologue); bool do_pcm_dtmf_blocking = is_pcm_dtmf_block_mode(dtmf_block_mode); diff --git a/daemon/websocket.c b/daemon/websocket.c index 5ac51defd..6f6974989 100644 --- a/daemon/websocket.c +++ b/daemon/websocket.c @@ -382,8 +382,7 @@ static const char *websocket_http_metrics(struct websocket_message *wm) { AUTO_CLEANUP_INIT(GQueue *metrics, statistics_free_metrics, statistics_gather_metrics(NULL)); g_autoptr(GString) outp = g_string_new(""); - AUTO_CLEANUP_INIT(GHashTable *metric_types, __g_hash_table_destroy, - g_hash_table_new(g_str_hash, g_str_equal)); + g_autoptr(GHashTable) metric_types = g_hash_table_new(g_str_hash, g_str_equal); for (GList *l = metrics->head; l; l = l->next) { struct stats_metric *m = l->data; diff --git a/lib/auxlib.h b/lib/auxlib.h index ce4db382f..0d28fb6dc 100644 --- a/lib/auxlib.h +++ b/lib/auxlib.h @@ -341,9 +341,6 @@ INLINE void g_tree_clear(GTree *t) { g_tree_remove(t, k); } } -INLINE void __g_hash_table_destroy(GHashTable **s) { - g_hash_table_destroy(*s); -} int g_tree_find_first_cmp(void *, void *, void *);