Re: nsString

Alvin4u <[email protected]> Mon, 5 Dec 2011 19:46:17 -0800 (PST)
Newsgroups gmane.comp.mozilla.devel.embedding
Organization http://groups.google.com
Message-ID <37b3c295-b7fd-4a8f-8337-bd77f0c9e302@ca1g2000vbb.googlegroups.com>
On 12月6日, 上午2时18分, Igor Tandetnik <[email protected]> wrote:
> On 12/4/2011 9:23 PM, FrAnk Alvin wrote:
>
> > nsString attributeName
> > char* attrName = NS_ConvertUTF16toUTF8(attributeName).get();
>
> This creates a temporary instance of NS_ConvertUTF16toUTF8. At the
> semicolon, this temporary is destroyed, deallocating the memory and
> leaving attrName a dangling reference.
> --
> Igor Tandetnik

thanks for you point out mistakes so that they can be corrected.
tks~~~

alvin
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding