Re: [Vala] Clutter actor class in Vala (newb)



Hello,

On Thursday, 11 April, 2013 03:51 PM, Donn wrote:
https://developer.gnome.org/clutter/stable/ClutterCanvas.html
Scroll down to 'Description' - there's sample code.

1. In the int main, at: canvas = clutter_canvas_new();
2. They do: clutter_actor_set_content( actor, canvas );
3. A few lines down they do:
/* the actor now owns the canvas */
g_object_unref(canvas);

In my vala class, I did:
this.set_content(canvas);

Should I be worrying about canvas? (Declare it weak, maybe?)
Or, is it okay since it's defined and used within the class?

Vala will automatically add code to decrease its references by one (unref) once the block where it belongs ends (in this case, the class constructor).


Regards,

Arnel A. Borja


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