diff --git a/daemon/cdr.c b/daemon/cdr.c index 23fe2cc7c..190cdf032 100644 --- a/daemon/cdr.c +++ b/daemon/cdr.c @@ -40,7 +40,7 @@ void cdr_update_entry(struct call* c) { struct call_monologue *ml; struct timeval tim_result_duration; int cdrlinecnt = 0; - AUTO_CLEANUP_INIT(GString *cdr, __g_string_free, g_string_new("")); + g_autoptr(GString) cdr = g_string_new(""); struct call_media *md; GList *o; const struct rtp_payload_type *rtp_pt; diff --git a/daemon/janus.c b/daemon/janus.c index 4c1eee012..12272d914 100644 --- a/daemon/janus.c +++ b/daemon/janus.c @@ -508,7 +508,7 @@ static const char *janus_videoroom_join(struct websocket_message *wm, struct jan return "User already exists in the room as a publisher"; uint64_t feed_id = 0; // set for single feed IDs, otherwise remains 0 - AUTO_CLEANUP_INIT(GString *feed_ids, __g_string_free, g_string_new("feeds ")); // for log output + g_autoptr(GString) feed_ids = g_string_new("feeds "); // for log output AUTO_CLEANUP(GQueue ret_streams, janus_clear_ret_streams) = G_QUEUE_INIT; // return list for multiple subs if (is_pub) { diff --git a/daemon/websocket.c b/daemon/websocket.c index fc73cb894..5ac51defd 100644 --- a/daemon/websocket.c +++ b/daemon/websocket.c @@ -381,7 +381,7 @@ static const char *websocket_http_metrics(struct websocket_message *wm) { ilogs(http, LOG_DEBUG, "Respoding to GET /metrics"); AUTO_CLEANUP_INIT(GQueue *metrics, statistics_free_metrics, statistics_gather_metrics(NULL)); - AUTO_CLEANUP_INIT(GString *outp, __g_string_free, g_string_new("")); + 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)); diff --git a/lib/auxlib.h b/lib/auxlib.h index 9f469a303..ce4db382f 100644 --- a/lib/auxlib.h +++ b/lib/auxlib.h @@ -341,12 +341,6 @@ INLINE void g_tree_clear(GTree *t) { g_tree_remove(t, k); } } -INLINE void g_string_free_true(GString *s) { - g_string_free(s, TRUE); -} -INLINE void __g_string_free(GString **s) { - g_string_free(*s, TRUE); -} INLINE void __g_hash_table_destroy(GHashTable **s) { g_hash_table_destroy(*s); }