Re: Problem with GValue



Maciej Piechotka wrote:

On 2/17/06, Fernando Apesteguía <fernando apesteguia gmail com> wrote:
Sorry if this is so trivial...

Did you try to g_free it?

Best regards!


Sorry. I didn't understand g_value_init function. Sorry.


Wait... hold your horses ! ;-)

If a GValue has been g_value_set_* () in its lifetime at least once; it must be
g_value_unset () sometime after.

Although not doing so may not be a memory leak for most cases;
a G_TYPE_STRING  for example will hold a copy of the string on the GValue,
this will only be freed with g_value_unset().

Its also common practice to just use a GValue on the stack and save yourself a g_free.

Cheers,
                                       -Tristan




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