[webkit-help] Assigning String::utf8().data to another pointer

fun runner funrunner0 at gmail.com
Sat Nov 20 07:34:51 PST 2010


Yes. It works. I saw that used in all gtk calls by using g_strdup. But I
would like to prevent duplication.

Why assigning it is not allowed?

On Sat, Nov 20, 2010 at 8:12 PM, Antonio Gomes <tonikitoo at gmail.com> wrote:

> what happens if you do:
>
> >     String trial("trial");
> >     single = trial.utf8().data();
>
> single = strdup(trial.utf8().data())
>
> >     std:: cout << "trial is " << trial.utf8().data() << std::endl;
> >     std:: cout << "single is " << single << std::endl;
>
> free(single);
>
> ?
>
> --Antonio
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20101120/81fecba0/attachment.html>


More information about the webkit-help mailing list