On 7/5/17 5:41 AM, nmago wrote:
char* cname = new char[N];
memcpy(cname, &name, N);
nsACString strName(cname, N, 0);

This copies the data twice, and leaks it once, as far as I can tell.

What, exactly, are you trying to accomplish? For example, do you need an nsACString that has a copy of your data or just points into it temporarily?

-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to