docs: advise not to use non-literal strings as qdata keys
@mcrha
Submitted by Milan Crha Link to original bug (#697114)
Description
As is stated in bug #696757, the g_object_set_data() leaks memory for 'key' parameter when the parameters is an allocated string. There is no restriction on keys in documentation, thus this leak is unexpected. Adding such restriction is also unexpected, quite limiting.
Relevant part of a valgrind log:
32,768 bytes in 1 blocks are definitely lost in loss record 4,033 of 4,039 at 0x4C28BED: malloc (vg_replace_malloc.c:263) by 0x8AF8D40: g_malloc (gmem.c:159) by 0x8B01AF5: g_quark_from_string (gquark.c:278) by 0x8673FFC: g_object_set_data (gobject.c:3318)
Version: 2.34.x