Bug 708499 - Fix wstring memory leak on mozilla-beta. r=bz, a=akeybl
authorBobby Holley <bobbyholley@gmail.com>
Fri, 09 Dec 2011 13:13:30 -0800
changeset 79304 2dc222dac518fd53ef6cbf2eab5b31c5b4c7e91c
parent 79303 06f94caa18d4fa4d838a22b7110da7ba6f8f91f1
child 79305 4d4553e11c579f72398bcdcd58d6325b0e5779c3
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, akeybl
bugs708499
milestone9.0
Bug 708499 - Fix wstring memory leak on mozilla-beta. r=bz, a=akeybl
js/src/xpconnect/src/xpcwrappednative.cpp
--- a/js/src/xpconnect/src/xpcwrappednative.cpp
+++ b/js/src/xpconnect/src/xpcwrappednative.cpp
@@ -2853,16 +2853,17 @@ CallMethodHelper::ConvertIndependentPara
         if(type.IsPointer())
         {
             switch(type_tag)
             {
             case nsXPTType::T_IID:
                 dp->SetValNeedsCleanup();
                 break;
             case nsXPTType::T_CHAR_STR:
+            case nsXPTType::T_WCHAR_STR:
                 dp->SetValNeedsCleanup();
                 break;
             case nsXPTType::T_ASTRING:
                 // Fall through to the T_DOMSTRING case
 
             case nsXPTType::T_DOMSTRING:
                 dp->SetValNeedsCleanup();
                 break;
@@ -2975,17 +2976,18 @@ CallMethodHelper::ConvertDependentParams
             NS_ASSERTION(i < mArgc || paramInfo.IsOptional(),
                          "Expected either enough arguments or an optional argument");
             src = i < mArgc ? mArgv[i] : JSVAL_NULL;
 
             if((datum_type.IsPointer() &&
                 (datum_type.TagPart() == nsXPTType::T_IID ||
                  datum_type.TagPart() == nsXPTType::T_PSTRING_SIZE_IS) ||
                  datum_type.TagPart() == nsXPTType::T_PWSTRING_SIZE_IS) ||
-               (isArray && datum_type.TagPart() == nsXPTType::T_CHAR_STR))
+               (isArray && (datum_type.TagPart() == nsXPTType::T_CHAR_STR ||
+                            datum_type.TagPart() == nsXPTType::T_WCHAR_STR)))
             {
                 dp->SetValNeedsCleanup();
             }
         }
 
         nsID param_iid;
         if(datum_type.IsInterfacePointer() &&
            !GetInterfaceTypeFromParam(i, datum_type, &param_iid))