pan-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pan-devel] mem-leaks


From: Haran Shivanan
Subject: [Pan-devel] mem-leaks
Date: Mon, 13 Jan 2003 11:18:37 +0530 (IST)

Module 'Christophe Lambin' core dumped on 12 Jan 2003 with the following output

>
> This patch still leaks tags when changing colours:
> text_set_text_buffer_tags() allocates these unconditionally, so
> gtk_text_tag_table_install() should free them when existing_tag==1.
> Looking at the documentation for GtkTextTag, I see no destructor for
> this data type. How should one free these?

Well, I found a couple of solutions but I'm not sure if they're correct
because I'm a little shaky on GTK's reference counting policy.

First, I can explicitly do a g_free on the GtkTextTag object and this
doesn't seem to cause any problems when I did some simple tests.

Second, instead of explicitly copying tag structure members when
installing the new tags, I tried a

memcpy (new_tag, old_tag, sizeof(GtkTextTag);

and this also seems to work OK and should be more robust in case of
changes to the internal members of the data structure.

However, will this screw up the refcounting system used by GTK?
I don't think so but I'm not sure.

Any ideas?

Haran

-- 
Over thinking,over analyzing seperates the body from the mind





reply via email to

[Prev in Thread] Current Thread [Next in Thread]