Here is the adjusted file with all of code of why I am using "out"

valac -g --pkg libsoup-2.4 --pkg gee-1.0 --pkg gnet-2.0 --pkg
json-glib-1.0 --save-temps --thread mywebapp.vala
https://gist.github.com/922304

mywebapp.vala:11.29-11.39: error: No reference to be transferred
        Soup.Message msg2 = (owned) msg;
                            ^^^^^^^^^^^
Compilation failed: 1 error(s), 0 warning(s)


On Fri, Apr 15, 2011 at 12:18 PM, Joseph Montanez
<[email protected]> wrote:
> Abderrahim,
>
> 1)  msg = (owned) msg;
>    Results in "No reference to be transferred"
>
>    As to why I am using "out" is because when I was changing the
> "msg.response_headers" and the changes where not being reflected back
> when I was finished using msg.
>
> 2)  public string get_session_id (unowned Soup.Message msg)
>    Results in "error: syntax error, `new' modifier not allowed on
> creation method"
>    This tries to initialize the variable msg
>
>
>
>
> On Fri, Apr 15, 2011 at 10:36 AM, Abderrahim Kitouni
> <[email protected]> wrote:
>> Hello,
>>
>> On Thu, Apr 14, 2011 at 6:45 PM, Joseph Montanez
>>> <[email protected]> wrote:
>>> > I got it, I needed
>>> >
>>> > public void dostuff (out unowned Soup.Message msg)
>>> >
>>> > and then I could do:
>>> > dostuff(out msg);
>>> >
>>
>> No you shouldn't. You probably need to transfer ownership as in:
>>
>> public void dostuff (out unowned Soup.Message msg) {
>>        ...
>>        msg = (owned) ...;
>> }
>>
>> btw, why using an out argument? If you need to return only one value,
>> it'd be easier to use a return value instead.
>>
>>                 في ج، 15-04-2011 عند 10:18 -0700 ، كتب Joseph Montanez:
>>> Actually when I access anything from "msg", it just segment faults :(
>>>
>>> https://gist.github.com/922060
>>
>> What's this? Why do you think you need 'out' here? You should simply
>> remove the 'out' keyword (and 'unowned' as well, since it would be
>> unowned by default).
>>
>>
>> HTH,
>> Abderrahim
>>
>>
>
>
>
> --
> Joseph Montanez
> Web Developer
> Gorilla3D
> Design, Develop, Deploy
>



-- 
Joseph Montanez
Web Developer
Gorilla3D
Design, Develop, Deploy
_______________________________________________
vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to