This is generally safe, since objects are reference counted. Even if the async method keeps executing in the background, the async method will decrease it's reference when it no longer needs the object (this is done automatically for you), in which case the object will be freed (that if there is no other reference for this object somewhere else).
*Alexandre Rosenfeld* On Fri, Apr 15, 2011 at 20:00, Nor Jaidi Tuah <[email protected]>wrote: > Is the following safe? Will the argument be > freed when xx returns, but async_method is still > in the background? > > void xx () { > async_method (new SomeObject ()); > } > > What about the "this" argument in the following; > is it safe? > > void xx () { > var y = new SomeOject (); > y.async_method (); > } > > I tried to figure out the answer to these question > from the generated C, but was lost in the tangle. > > hand > Nor Jaidi Tuah > > > _______________________________________________ > vala-list mailing list > [email protected] > http://mail.gnome.org/mailman/listinfo/vala-list >
_______________________________________________ vala-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/vala-list
