Re: [Vala] Threads with return value... Isn't this a memory leak?



Marco Trevisan "(Treviño)" <mail 3v1n0 net> writes:

Il giorno mar, 04/01/2011 alle 16.30 +0100, Marco Trevisan (Treviño) ha
scritto:
The same happens using strings, but not with more complex object (like
GLib.Array, for example)... Is this a bug?
Why is this happening?

Sorry, I've double-checked. A string is correclty free'd; but int* is
not (and I guess the same happens with other pointers like that).

From http://live.gnome.org/Vala/Tutorial#Pointers

Pointers are Vala's way of allowing manual memory management. Normally
when you create an instance of a type you receive a reference to it, and
Vala will take care of destroying the instance when there are no more
references left to it. By requesting instead a pointer to an instance,
you take responsibility for destroying the instance when it is no longer
wanted, and therefore get greater control over how much memory is used.



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