Fix the implementation of interned refstrings

Desktop / GNOME / GLib - Emmanuele Bassi [gnome.org] - 9 July 2018 09:11 EDT

The global hash table we use for interned strings should not own a reference on the strings themselves, as otherwise we'd leak them all over the place.

Instead, it should keep a "weak" reference to them; once the last strong reference goes away, we drop remove the weak reference from the hash table.

4248b4b30 Fix the implementation of interned refstrings
glib/grefstring.c | 107 ++++++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 92 insertions(+), 15 deletions(-)

Upstream: git.gnome.org


  • Share