Re: [Vala] Floating references
- From: Luca Bruno <lethalman88 gmail com>
- To: Alberto Mardegan <alberto mardegan canonical com>
- Cc: Vala list <vala-list gnome org>
- Subject: Re: [Vala] Floating references
- Date: Thu, 24 May 2012 12:22:37 +0200
On Tue, May 15, 2012 at 1:21 PM, Alberto Mardegan <
alberto mardegan canonical com> wrote:
========
[ CCode ( returns_floating_reference = true ) ]
public override unowned Gtk.Widget build_widget () {
return new Gtk.Label ("Hello world!");
}
========
but the code doesn't compile: "Return value transfers ownership but
method return type hasn't been declared to transfer ownership". If I
introduce a member variable to hold the GtkWidget then it works, but the
generated C code still calls g_object_ref_sink().
It seems that the "returns_floating_reference" does nothing, or I didn't
understand how to use it?
The return type must be still owned.
--
www.debian.org - The Universal Operating System
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]