grefstring: Mark a variable as potentially unused

It is unused when compiling with `G_DISABLE_ASSERT`. That’s fine, but we
definitely want the `g_hash_table_remove()` call to still be made.

Fixes this CI failure: https://gitlab.gnome.org/GNOME/glib/-/jobs/4483098

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2024-11-13 13:50:44 +00:00
parent 7dacfa7799
commit 55966083e6
No known key found for this signature in database
GPG Key ID: C5C42CFB268637CA

View File

@ -279,7 +279,9 @@ retry:
/* If the string was not given out again in the meantime we're done */
if (g_atomic_int_dec_and_test (&impl->ref_count))
{
gboolean removed = g_hash_table_remove (interned_ref_strings, str);
gboolean removed G_GNUC_UNUSED /* when compiling with G_DISABLE_ASSERT */;
removed = g_hash_table_remove (interned_ref_strings, str);
g_assert (removed);
if (g_hash_table_size (interned_ref_strings) == 0)