Bug 500068 thundersomething addon constantly crashes tb 2.0.0.22 final (win32, winxp) [@ nsCharTraits<unsigned short>::length - nsPref::SetUnicharPref]
authortimeless@mozdev.org
Wed, 22 Jul 2009 17:31:04 -0500
changeset 30580 1654af0def9da5b0146fb6389fd6a0bc699fe0a1
parent 30579 cfdb650315aad12d9f2d041e02c100b9ec80887c
child 30581 2956e5255fc9ce8ff77cd61df1a7a68dfa168816
push id8141
push userdb48x@yahoo.com
push dateWed, 22 Jul 2009 22:33:25 +0000
treeherdermozilla-central@2956e5255fc9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs500068
milestone1.9.2a1pre
Bug 500068 thundersomething addon constantly crashes tb 2.0.0.22 final (win32, winxp) [@ nsCharTraits<unsigned short>::length - nsPref::SetUnicharPref] r=dveditz
modules/libpref/src/nsPref.cpp
--- a/modules/libpref/src/nsPref.cpp
+++ b/modules/libpref/src/nsPref.cpp
@@ -442,30 +442,32 @@ NS_IMETHODIMP nsPref::CopyDefaultUnichar
 NS_IMETHODIMP nsPref::SetUnicharPref(const char *pref, const PRUnichar *value)
 {
   nsresult rv;
 
   nsCOMPtr<nsIPrefBranch> prefBranch = do_QueryInterface(mPrefService, &rv);
   if (NS_SUCCEEDED(rv)) {
     nsCOMPtr<nsISupportsString> theString = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv);
     if (NS_SUCCEEDED(rv)) {
-      theString->SetData(nsDependentString(value));
+      nsAutoString val(value);
+      theString->SetData(val);
       rv = prefBranch->SetComplexValue(pref, NS_GET_IID(nsISupportsString), theString);
     }
   }
   return rv;
 }
 
 NS_IMETHODIMP nsPref::SetDefaultUnicharPref(const char *pref, const PRUnichar *value)
 {
   nsresult rv;
 
   nsCOMPtr<nsISupportsString> theString = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv);
   if (NS_SUCCEEDED(rv)) {
-    theString->SetData(nsDependentString(value));
+    nsAutoString val(value);
+    theString->SetData(val);
     rv = mDefaultBranch->SetComplexValue(pref, NS_GET_IID(nsISupportsString), theString);
   }
   return rv;
 }
 
 NS_IMETHODIMP nsPref::GetLocalizedUnicharPref(const char *pref, PRUnichar **_retval)
 {
   nsresult rv;