if (!outArray) { nsMemory::Free(*uuid); return NS_ERROR_OUT_OF_MEMORY; }
xpcarraytest::CallEchoMethodOnEachInArray(nsIID * *uuid, PRUint32 *count, void * **result){    NS_ENSURE_ARG_POINTER(uuid);    NS_ENSURE_ARG_POINTER(count);    NS_ENSURE_ARG_POINTER(result);    if(mReceiver)        return mReceiver->CallEchoMethodOnEachInArray(uuid, count, result);    // check that this is the expected type    if(!(*uuid)->Equals(NS_GET_IID(nsIEcho)))        return NS_ERROR_FAILURE;    // call each and release    nsIEcho** ifaceArray = (nsIEcho**) *result;    for(PRUint32 i = 0; i < *count; i++)    {        ifaceArray[i]->SendOneString("print this from C++");        NS_RELEASE(ifaceArray[i]);    }    // cleanup    nsMemory::Free(*uuid);    nsMemory::Free(*result);    // set up to hand over array of 'this'    *uuid = (nsIID*) nsMemory::Clone(&NS_GET_IID(nsIXPCTestArray),                                         sizeof(nsIID));    nsISupports** outArray = (nsISupports**)             nsMemory::Alloc(2 * sizeof(nsISupports*));    outArray[0] = outArray[1] = this;        NS_ADDREF(this);    NS_ADDREF(this);    *result = (void**) outArray;    *count = 2;    return NS_OK;}        