Skip to content

core: function documentation clarification

I suspect because of unclear documentation several calls was not disposing resources properly (or disposes them twice) causing mem-leaks or mem-corruption.

So I want to clarify documentation on several name-set functions. (this is first step) so further usage will be (hopefully) less bug prone.

I haven't checked all the calls (yet) and before investigating further I want to get confirmation that I on the right track (and that I documented functions right)

for example (fixed in other MR)

/* from app/file/file-utils.c line 179 */
  gchar         *uri;
  uri = g_file_get_uri (file);
  thumbnail = gimp_thumbnail_new ();
  gimp_thumbnail_set_uri (thumbnail, uri);

  /* at this point uri should be g_free'd but it is not.
     gimp_thumbnail_set_uri () makes `copy` of passed uri
     so we have a mem-leak there.
  */

  ...
Edited by Stanislav Grinkov

Merge request reports