From 91d66f766267c1891a48bf03fab4f9798bbed0e5 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 6 Feb 2009 06:59:44 +0000 Subject: [PATCH] Mismatched delete / delete [] --- src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx | 2 +- src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx | 4 ++-- src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx | 2 +- src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx index d15a29561..d0a564c89 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx @@ -307,7 +307,7 @@ void SALOMEDSImpl_AttributeStudyProperties::Load(const string& value) strncpy(aName, &(aCopy[anIndex]), aNameSize); aName[aNameSize] = 0; SetModification(aName,aMinute,aHour,aDay,aMonth,aYear); - delete(aName); + delete [] (aName); anIndex += aNameSize + 1; } if (aCopy[1] == 'l') { diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx index aace61317..91c4560c5 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx @@ -443,7 +443,7 @@ string SALOMEDSImpl_AttributeTreeNode::Type() char* aNodeName = new char[127]; sprintf(aNodeName, "AttributeTreeNodeGUID%s", ID().c_str()); string ret(aNodeName); - delete aNodeName; + delete [] aNodeName; return ret; } @@ -462,7 +462,7 @@ string SALOMEDSImpl_AttributeTreeNode::Save() char* aResult = new char[aLength]; sprintf(aResult, "%s %s %s %s", aFather.c_str(), aPrevious.c_str(), aNext.c_str(), aFirst.c_str()); string ret(aResult); - delete aResult; + delete [] aResult; return ret; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx index 2b88c9b89..063562ae3 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx @@ -767,7 +767,7 @@ bool SALOMEDSImpl_Study::IsModified() _errorCode = ""; // True if is modified - if (_doc->IsModified()) return true; + if (_doc && _doc->IsModified()) return true; return false; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx index 823cde555..ddd188d22 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx @@ -1195,7 +1195,7 @@ static void ReadAttributes(SALOMEDSImpl_Study* theStudy, } else if (!strcmp(hdf_dataset->GetName(),"AttributeReference") || !strcmp(hdf_dataset->GetName(),"Reference")) { // Old format maintainance theStudy->NewBuilder()->Addreference(aSO, theStudy->CreateObjectID(current_string)); - delete(current_string); + delete [] (current_string); hdf_dataset->CloseOnDisk(); return; } else { @@ -1206,7 +1206,7 @@ static void ReadAttributes(SALOMEDSImpl_Study* theStudy, anAttr->Load(current_string); } - delete(current_string); + delete [] (current_string); hdf_dataset->CloseOnDisk(); } -- 2.39.2