From 2851cd519338ef4a1fde15da8d4015ab4380d6cb Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 28 Nov 2011 11:33:49 -0700 Subject: a try fix for sh-2651: [crashhunters] Crash after google translate failure and sh-2658: crash in LLPluginMessage::parse --- indra/llprimitive/llvolumexml.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'indra/llprimitive/llvolumexml.cpp') diff --git a/indra/llprimitive/llvolumexml.cpp b/indra/llprimitive/llvolumexml.cpp index f4f9d4d713..bf2297a029 100644 --- a/indra/llprimitive/llvolumexml.cpp +++ b/indra/llprimitive/llvolumexml.cpp @@ -34,9 +34,9 @@ //============================================================================ -LLXMLNode *LLVolumeXml::exportProfileParams(const LLProfileParams* params) +LLPointer LLVolumeXml::exportProfileParams(const LLProfileParams* params) { - LLXMLNode *ret = new LLXMLNode("profile", FALSE); + LLPointer ret = new LLXMLNode("profile", FALSE); ret->createChild("curve_type", TRUE)->setByteValue(1, ¶ms->getCurveType()); ret->createChild("interval", FALSE)->setFloatValue(2, ¶ms->getBegin()); @@ -46,9 +46,9 @@ LLXMLNode *LLVolumeXml::exportProfileParams(const LLProfileParams* params) } -LLXMLNode *LLVolumeXml::exportPathParams(const LLPathParams* params) +LLPointer LLVolumeXml::exportPathParams(const LLPathParams* params) { - LLXMLNode *ret = new LLXMLNode("path", FALSE); + LLPointer ret = new LLXMLNode("path", FALSE); ret->createChild("curve_type", TRUE)->setByteValue(1, ¶ms->getCurveType()); ret->createChild("interval", FALSE)->setFloatValue(2, ¶ms->getBegin()); ret->createChild("scale", FALSE)->setFloatValue(2, params->getScale().mV); @@ -63,12 +63,15 @@ LLXMLNode *LLVolumeXml::exportPathParams(const LLPathParams* params) } -LLXMLNode *LLVolumeXml::exportVolumeParams(const LLVolumeParams* params) +LLPointer LLVolumeXml::exportVolumeParams(const LLVolumeParams* params) { - LLXMLNode *ret = new LLXMLNode("shape", FALSE); + LLPointer ret = new LLXMLNode("shape", FALSE); - exportPathParams(¶ms->getPathParams())->setParent(ret); - exportProfileParams(¶ms->getProfileParams())->setParent(ret); + LLPointer node ; + node = exportPathParams(¶ms->getPathParams()) ; + node->setParent(ret); + node = exportProfileParams(¶ms->getProfileParams()) ; + node->setParent(ret); return ret; } -- cgit v1.2.3