Bug 692342 - Move a call to SetValNeedsCleanup() to an equivalent location. r=mrbkap
authorBobby Holley <bobbyholley@gmail.com>
Fri, 25 Nov 2011 17:09:07 -0800
changeset 82431 47047b832f461be251f969588e920fb278a3dca4
parent 82430 a8300adcea7242fe1c652eb9745624e8b435f309
child 82432 206075dcdf40dd80588fa6676b692e278ca3f86b
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs692342
milestone11.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 692342 - Move a call to SetValNeedsCleanup() to an equivalent location. r=mrbkap
js/xpconnect/src/XPCWrappedNative.cpp
--- a/js/xpconnect/src/XPCWrappedNative.cpp
+++ b/js/xpconnect/src/XPCWrappedNative.cpp
@@ -2726,33 +2726,32 @@ CallMethodHelper::ConvertDependentParam(
         dp->SetIndirect();
 
     if (isArray) {
         if (NS_FAILED(mIFaceInfo->GetTypeForParam(mVTableIndex, &paramInfo, 1,
                                                   &datum_type))) {
             Throw(NS_ERROR_XPC_CANT_GET_ARRAY_INFO, mCallContext);
             return JS_FALSE;
         }
-    } else
+        if (datum_type.IsPointer())
+            dp->SetValNeedsCleanup();
+    } else {
         datum_type = type;
+    }
 
     if (datum_type.IsInterfacePointer()) {
         dp->SetValNeedsCleanup();
     }
 
     jsval src;
 
     if (!GetOutParamSource(i, &src))
         return JS_FALSE;
 
     if (paramInfo.IsOut()) {
-        if (datum_type.IsPointer() &&
-            isArray)
-            dp->SetValNeedsCleanup();
-
         if (!paramInfo.IsIn())
             return JS_TRUE;
     } else {
         NS_ASSERTION(i < mArgc || paramInfo.IsOptional(),
                      "Expected either enough arguments or an optional argument");
         src = i < mArgc ? mArgv[i] : JSVAL_NULL;
 
         if (datum_type.TagPart() == nsXPTType::T_IID ||