Re: [Vala] Fail to generate C code for following vala code, is this a bug?
- From: PCMan <pcman tw gmail com>
- To: Jan Hudec <bulb ucw cz>
- Cc: vala-list gnome org
- Subject: Re: [Vala] Fail to generate C code for following vala code, is this a bug?
- Date: Sat, 27 Mar 2010 19:28:30 +0800
Thanks you guys for the help.
I use my own modified version of gio.vapi and remove the *_finish
functions from those interfaces. Then, it works.
Although I don't know why it works. Thank you again.
On Sat, Mar 27, 2010 at 5:56 AM, Jan Hudec <bulb ucw cz> wrote:
On Sat, Mar 27, 2010 at 03:57:26 +0800, PCMan wrote:
So, the problem is that the function return values are falsely
marked as unowned in the VAPI. I reported a bug for it at
https://bugzilla.gnome.org/show_bug.cgi?id=614044
However, with Vala, how can I make vala methods return a "newly
allocated GList" with all objects in it having increased ref_count?
Automatic ref couting management in Vala is handy if you only use it
in Vala but I find it difficult to make things right when interfacing
with C code. I need to check the generated C code to see if it does
what I really want. Any better guide for this? Already read Vala
tutorial, but I still haven't get it.
Just don't mark the list as unowned.
But in the glib2 vapi, prototype of that API has 'unowned', but in C,
the returned list should be freed by the caller. So how can I override
this method in correct way?
The bug in the vapi has to be fixed.
--
Jan 'Bulb' Hudec <bulb ucw cz>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]