Follow-up Comment #2, bug #19064 (project freeciv):

I don't have a complete picture of what's going on yet, but I'm a little
dubious about this code in gui-gtk-2.0/chatline.c:apply_text_tag():

  GtkTextBuffer *buf;
  /* ... */
  case TTT_COLOR:
      /* We have to make a new tag every time. */
      GtkTextTag *tag = NULL;
      /* ... */
      tag = gtk_text_buffer_create_tag(buf, NULL, /* ... */);
      /* ... */
      gtk_text_buffer_apply_tag(buf, tag, /* ... */);
      g_object_unref(G_OBJECT(tag)); /* Bad? */

Looking at the gtk_text_buffer_create_tag() docs
I _think_ that the ownership of the created tag is passed to a structure
inside 'buf', so the caller doesn't have to free it. The annotation "transfer
none" apparently
<> means
"Don't free data after the code is done", which I think may corroborate my

The same applies to case TTT_LINK.

This server uses loads of colours, though, so I'm not sure why we're not
seeing loads of these warnings. Perhaps the reference count only drops below
zero in unusual circumstances. Or perhaps this possible thing I've found has
nothing to do with these warnings.


Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to