Re: [Vala] gtk treeview (one column) example




On Thu, 2007-11-08 at 21:07 +0100, pancake wrote:
On Thu, Nov 08, 2007 at 06:36:08PM +0100, J?rg Billeter wrote:
You should be able to use

string foo;
?tv.model.get(ref iter, 0, out foo);

to retrieve a string. Your version will lead to a memory leak as the
preallocated GString will be replaced by the string allocated by the
tree model.

this kind of things should be detected by the compiler or at least
documented anywhere and do not relay on the final user to make this
things well, because they're a bit confusing (and there's no doc ?)

The issue here is that TreeModel.get is a varargs function, it shouldn't
happen with methods with typed parameters. The possibility to check
varargs functions will be very limited.

Jürg




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