From 12a181b5d5c05e1c8a0d43082994f988ee41b085 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Thu, 19 Feb 2026 11:23:01 +0100 Subject: [PATCH] cleanup: Wrap release handler in iq.c GDestroyNotify takes a void* and returns void. Wrap xmpp_stanza_release to get rid of the incompatible function type warning. --- src/xmpp/iq.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c index a8a485b2..c2296748 100644 --- a/src/xmpp/iq.c +++ b/src/xmpp/iq.c @@ -248,6 +248,12 @@ _iq_handler(xmpp_conn_t* const conn, xmpp_stanza_t* const stanza, void* const us return 1; } +static void +_xmpp_stanza_release_destroy_notify(gpointer data) +{ + xmpp_stanza_release((xmpp_stanza_t*)data); +} + void iq_handlers_init(void) { @@ -264,7 +270,7 @@ iq_handlers_init(void) iq_handlers_clear(); id_handlers = g_hash_table_new_full(g_str_hash, g_str_equal, free, (GDestroyNotify)_iq_id_handler_free); - rooms_cache = g_hash_table_new_full(g_str_hash, g_str_equal, free, (GDestroyNotify)xmpp_stanza_release); + rooms_cache = g_hash_table_new_full(g_str_hash, g_str_equal, free, _xmpp_stanza_release_destroy_notify); } struct iq_win_finder