Blake Kaplan wrote:

Neil <n...@parkwaycc.co.uk> wrote:
static const PRUnichar* kResetBackupDirectory = 
NS_LITERAL_STRING("resetBackupDirectory").get();
Isn't this an anti-pattern anyway because the string (and the memory owned by it) will 
get destructed after the semicolon "runs" leaving kResetBackupDirectory 
pointing at deleted memory?
Yes, this is why I said it is technically incorrect, but we use a string literal (L"" or u"") where we can; only on systems that don't support UTF16 string literals do we allocate memory. If no such systems remain, we should really switch to NS_L("resetBackupDirectory") throughout.

--
Warning: May contain traces of nuts.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to