Wow, this works perfectly!!!

On 27 June 2011 09:11, Luca Bruno <[email protected]> wrote:
> Use unowned arrays to avoid copies:
>
> unowned uint8[] data = (uint8[]) stmt.column_blob(4);
> data.length = whatever...
> var copied_data = data; // now you can copy the data

So we need to set the "data" variable length before using the returned
data, and the only way to use the returned data without copying is
marking it as unowned.
Is this correct?

> We could use unowned uint8[] in the vapi anyway.
> Also, we should report an error when trying to copy an array with no known
> length.

Yes, it would avoid these unexpected crashes.
Anyway, I'm beginning with vala so maybe I am to new to notice these
little issues.


Thanks Luca and everyone,
Iñigo Serna
_______________________________________________
vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to