Re: [Vala] Fail to generate C code for following vala code, is this a bug?
- From: Jan Hudec <bulb ucw cz>
- To: PCMan <pcman tw gmail com>
- Cc: vala-list gnome org
- Subject: Re: [Vala] Fail to generate C code for following vala code, is this a bug?
- Date: Fri, 26 Mar 2010 22:56:12 +0100
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]