Re: [Vala] Invalid assignment from owned expression to unowned variable



I got it, I needed

public void dostuff (out unowned Soup.Message msg)

and then I could do:
dostuff(out msg);

On Thu, Apr 14, 2011 at 11:24 AM, Abderrahim Kitouni
<a kitouni gmail com> wrote:
Hello,

                في خ، 14-04-2011 عند 07:58 -0700 ، كتب Joseph Montanez:
I am trying to pass Soup.Message msg as a reference to another
function but I end up getting   "Invalid assignment from owned
expression to unowned variable". I tried

void default_handlertwo (Soup.Server server, Soup.Message msg, string path,
                          GLib.HashTable? query, Soup.ClientContext client)

public void dostuff (out Soup.Message msg)

//and then
dostuff(out msg);

//I tried casting (owned) on it as well
dostuff((owned) msg);

Are you sure the problem is here? I'd guess the problem is when you
assign the result to msg in the dostuff method. Can you try putting the
(owned) cast there?

HTH,
Abderrahim





-- 
Joseph Montanez
Web Developer
Gorilla3D
Design, Develop, Deploy



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