diff --git a/dali/base/dacsds.cpp b/dali/base/dacsds.cpp index 80fe9701144..3a23fdf5e4e 100644 --- a/dali/base/dacsds.cpp +++ b/dali/base/dacsds.cpp @@ -1108,13 +1108,12 @@ void CClientRemoteTree::resetState(unsigned _state, bool sub) serverId = 0; if (sub) { - IPropertyTreeIterator *iter = getElements("*"); + Owned iter = getElements("*"); ForEach(*iter) { CClientRemoteTree &child = (CClientRemoteTree &)iter->query(); child.resetState(state, sub); } - iter->Release(); } } diff --git a/dali/base/dafdesc.cpp b/dali/base/dafdesc.cpp index 5d672a16d78..825833e086a 100644 --- a/dali/base/dafdesc.cpp +++ b/dali/base/dafdesc.cpp @@ -3845,7 +3845,7 @@ class CStorageApiInfo : public CInterfaceOf throw makeStringExceptionV(-1, "No container provided: path %s", path.str()); return container; } - Linked xml; + Owned xml; }; class CStoragePlaneInfo : public CInterfaceOf diff --git a/dali/base/dasds.cpp b/dali/base/dasds.cpp index 489612a06a8..3e35e9a08b8 100644 --- a/dali/base/dasds.cpp +++ b/dali/base/dasds.cpp @@ -2699,7 +2699,7 @@ class CServerRemoteTree : public CRemoteTreeBase if (cutoff < 0 || depth iter = getElements("*"); iter->first(); while (iter->isValid()) { @@ -2708,8 +2708,6 @@ class CServerRemoteTree : public CRemoteTreeBase child->serializeCutOffRT(tgt, cutoff, depth+1, extValues); iter->next(); } - iter->Release(); - } tgt.append(""); // element terminator. i.e. blank child name. } diff --git a/dali/base/dasds.ipp b/dali/base/dasds.ipp index 9ea156b471c..b58e2fff0f9 100644 --- a/dali/base/dasds.ipp +++ b/dali/base/dasds.ipp @@ -166,7 +166,7 @@ public: bool res = true; if (op.applyTop(node)) { - IPropertyTreeIterator *iter = node.getElements("*"); + Owned iter = node.getElements("*"); if (iter->first()) { bool levelBreak = false; @@ -180,7 +180,6 @@ public: iter->next(); } } - iter->Release(); } return res; } diff --git a/dali/ft/filecopy.cpp b/dali/ft/filecopy.cpp index ec6f2923559..35df79c7d0b 100644 --- a/dali/ft/filecopy.cpp +++ b/dali/ft/filecopy.cpp @@ -2790,14 +2790,13 @@ bool FileSprayer::restorePartition() { if (allowRecovery && progressTree->getPropBool(ANhasPartition)) { - IPropertyTreeIterator * iter = progressTree->getElements(PNpartition); + Owned iter = progressTree->getElements(PNpartition); ForEach(*iter) { PartitionPoint & next = * new PartitionPoint; next.restore(&iter->query()); partition.append(next); } - iter->Release(); return (partition.ordinality() != 0); } return false; diff --git a/ecl/eclcc/eclcc.cpp b/ecl/eclcc/eclcc.cpp index 3ce11eb8e8d..ce0977aa0bb 100644 --- a/ecl/eclcc/eclcc.cpp +++ b/ecl/eclcc/eclcc.cpp @@ -3286,7 +3286,7 @@ int EclCC::parseCommandLineOptions(int argc, const char* argv[]) void EclCC::setSecurityOptions() { - IPropertyTree *eclSecurity = configuration->getPropTree("eclSecurity"); + Owned eclSecurity = configuration->getPropTree("eclSecurity"); if (eclSecurity) { // Name of security option in configuration yaml diff --git a/esp/bindings/http/platform/msgbuilder.cpp b/esp/bindings/http/platform/msgbuilder.cpp index b1cc23cbb35..a15d1ba132a 100644 --- a/esp/bindings/http/platform/msgbuilder.cpp +++ b/esp/bindings/http/platform/msgbuilder.cpp @@ -66,7 +66,7 @@ void CSoapMsgBuilder::setPropertyValueBool(const char * key, bool val) StringBuffer & CSoapMsgBuilder::getSoapResponse(StringBuffer & soapResponse) { - IPropertyTreeIterator * itr = m_properties->getElements("*"); + Owned itr = m_properties->getElements("*"); itr->first(); while(itr->isValid()) { @@ -77,7 +77,6 @@ StringBuffer & CSoapMsgBuilder::getSoapResponse(StringBuffer & soapResponse) soapResponse.appendf("<%s>%s", key.str(), val.str(), key.str()); itr->next(); } - itr->Release(); return soapResponse; } @@ -140,7 +139,7 @@ StringBuffer & CSoapMsgXsdBuilder::getXsd(StringBuffer & wsdlSchema) wsdlSchema.appendf("<%s:complexType name=\"%s\" >", m_var.str(), m_structLabel.str()); wsdlSchema.appendf("<%s:sequence>", m_var.str()); - IPropertyTreeIterator * itr = m_properties->getElements("*"); + Owned itr = m_properties->getElements("*"); itr->first(); while(itr->isValid()) { @@ -150,7 +149,6 @@ StringBuffer & CSoapMsgXsdBuilder::getXsd(StringBuffer & wsdlSchema) wsdlSchema.appendf("<%s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"%s\" type=\"xsd:%s\"/>", m_var.str(), name.str(), getXsdTypeLabel(static_cast(m_properties->getPropInt(name.str())))); itr->next(); } - itr->Release(); wsdlSchema.appendf("", m_var.str()); wsdlSchema.appendf("", m_var.str()); @@ -162,7 +160,7 @@ StringBuffer & CSoapMsgXsdBuilder::getXsd(StringBuffer & wsdlSchema) wsdlSchema.appendf("<%s:element name=\"%s\" nillable=\"true\" type=\"tns:%s\" />", m_var.str(), m_structLabel.str(), m_structLabel.str()); wsdlSchema.appendf("<%s:element name=\"ArrayOf%s\" nillable=\"true\" type=\"tns:ArrayOf%s\" />", m_var.str(), m_structLabel.str(), m_structLabel.str()); - return wsdlSchema; + return wsdlSchema; } const char * const XSD_STRING_DESC = "string"; @@ -188,7 +186,7 @@ CSoapMsgBuilder * CSoapMsgXsdBuilder::newMsgBuilder() { OwnednewXml = createPTree(m_structLabel.str()); - IPropertyTreeIterator * itr = m_properties->getElements("*"); + Owned itr = m_properties->getElements("*"); itr->first(); while(itr->isValid()) { @@ -208,7 +206,6 @@ CSoapMsgBuilder * CSoapMsgXsdBuilder::newMsgBuilder() } itr->next(); } - itr->Release(); StringBuffer xml; return new CSoapMsgBuilder(toXML(newXml, xml).str()); diff --git a/esp/platform/espcfg.cpp b/esp/platform/espcfg.cpp index 21a0fb87422..39b98561349 100644 --- a/esp/platform/espcfg.cpp +++ b/esp/platform/espcfg.cpp @@ -411,7 +411,7 @@ CEspConfig::CEspConfig(IProperties* inputs, IPropertyTree* envpt, IPropertyTree* #endif #endif - IPropertyTreeIterator *pt_iter = NULL; + Owned pt_iter; StringBuffer xpath; if (m_inputs->hasProp("SingleUserPass")) @@ -421,7 +421,7 @@ CEspConfig::CEspConfig(IProperties* inputs, IPropertyTree* envpt, IPropertyTree* m_inputs->getProp("SingleUserPass", plainesppass); encrypt(encesppass, plainesppass.str()); xpath.setf("SecurityManagers/SecurityManager[@type=\"SingleUserSecurityManager\"]/SingleUserSecurityManager/"); - pt_iter = m_cfg->getElements(xpath.str()); + pt_iter.setown(m_cfg->getElements(xpath.str())); if (pt_iter!=NULL) { IPropertyTree *ptree = NULL; @@ -442,8 +442,6 @@ CEspConfig::CEspConfig(IProperties* inputs, IPropertyTree* envpt, IPropertyTree* } pt_iter->next(); } - pt_iter->Release(); - pt_iter=NULL; } } @@ -470,7 +468,7 @@ CEspConfig::CEspConfig(IProperties* inputs, IPropertyTree* envpt, IPropertyTree* xpath.clear(); xpath.append("EspService"); - pt_iter = m_cfg->getElements(xpath.str()); + pt_iter.setown(m_cfg->getElements(xpath.str())); if (pt_iter!=NULL) { @@ -495,15 +493,12 @@ CEspConfig::CEspConfig(IProperties* inputs, IPropertyTree* envpt, IPropertyTree* } pt_iter->next(); } - - pt_iter->Release(); - pt_iter=NULL; } xpath.clear(); xpath.append("EspProtocol"); - pt_iter = m_cfg->getElements(xpath.str()); + pt_iter.setown(m_cfg->getElements(xpath.str())); if (pt_iter!=NULL) { @@ -530,15 +525,12 @@ CEspConfig::CEspConfig(IProperties* inputs, IPropertyTree* envpt, IPropertyTree* pt_iter->next(); } - - pt_iter->Release(); - pt_iter=NULL; } xpath.clear(); xpath.append("EspBinding"); - pt_iter = m_cfg->getElements(xpath.str()); + pt_iter.setown(m_cfg->getElements(xpath.str())); if (pt_iter!=NULL) { @@ -588,9 +580,6 @@ CEspConfig::CEspConfig(IProperties* inputs, IPropertyTree* envpt, IPropertyTree* pt_iter->next(); } - - pt_iter->Release(); - pt_iter=NULL; } } } diff --git a/tools/esdlcmd/esdl2ecl.cpp b/tools/esdlcmd/esdl2ecl.cpp index fa5ff0b7e80..0f6a83e0780 100644 --- a/tools/esdlcmd/esdl2ecl.cpp +++ b/tools/esdlcmd/esdl2ecl.cpp @@ -360,7 +360,7 @@ class Esdl2EclCmd : public EsdlConvertCmd int count = trees.all->getCount("esxdl"); if (trees.all->getCount("esxdl") > 0) { - IPropertyTree *file = trees.all->getPropTree("esxdl[1]"); + Owned file = trees.all->getPropTree("esxdl[1]"); if (file) { StringBuffer xmlfile;