Re: [Vala] Help with Memory Leak



I ran the following code for over 48 hours and there was no increase in the
heap size during that time:

    char *label = radioItem [item].label;
    char *text  = (item == 0) ? FORMAT [item].printf (val1)
                              : FORMAT [item].printf (readable (val1),
readable (val2));
    do *label++ = *text; while (*text++ != '\0');  //  There's no strcpy
() ... make our own!


The problem with this code is that the actual labels on the menu did not
update.  I then added the following line to inform the menu entries of a
change:

    radioItem [item].notify_property ("label");


and the heap size began its slow but steady increase again.

There are some things I could do to slow the increase of the heap (like
only updating the label if it changes, etc.), but this really only masks
the problem.  Does anyone know of a method that can be used to defrag the
heap, or specify it's maximum size?

Bruce


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