Code I

if (This->pMmValue)
{
  This->pMmValue->Release();
 This->pMmValue =NULL;
}

if (This->pMmUtils)
{
 This->pMmUtils->Release();
 This->pMmUtils =NULL;
}

if (This->pMmList)
{
 This->pMmList->Release();
 This->pMmList =NULL;
}

if (This->pDrPlayer)
{
  This->pDrPlayer->Release();
  This->pDrPlayer =NULL;
}

Code II

#define ARG_BASE	0

MoaError CScript_IMoaMmXScript::XScrpFixAllBugs(PMoaDrCallInfo callPtr)
{
	MoaError err = kMoaErr_NoErr;
	MoaMmValue value;
	MoaLong whichBug;
	MoaChar fixInfo[256] ={0};

	// Get at the integer for the bug num
	AccessArgByIndex(ARG_BASE + 1, &value);
	pObj->pMmValue->ValueToInteger(&value, &whichBug);

	// And the string for the name
	AccessArgByIndex(ARG_BASE + 2, &value);
	pObj->pMmValue->ValueToString(&value, &fixInfo[0], sizeof(fixInfo));

	// Now fix accordingly (this part you write :) 

	// And return success
	pObj->pMmValue->IntegerToValue(TRUE, callPtr->resultValue);

	return(err);
} /* fix all bugs */