]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Mismatched delete / delete []
authoreap <eap@opencascade.com>
Fri, 6 Feb 2009 06:59:44 +0000 (06:59 +0000)
committereap <eap@opencascade.com>
Fri, 6 Feb 2009 06:59:44 +0000 (06:59 +0000)
src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx
src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx
src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx

index d15a29561d2caf6f8b40872814124e911fc90856..d0a564c8907a96dd6e7fcc91fad33f20450015fe 100644 (file)
@@ -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') {
index aace61317db498f068cd6d082d0b4b8bfb38cd1e..91c4560c5d270a18e08c2cda19be27b0869300cc 100644 (file)
@@ -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;
 }
 
index 2b88c9b89b47c06e33a35c0be74447650b43894c..063562ae304ecf23228cfda72607fdf8f79acb2d 100644 (file)
@@ -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;
 }
index 823cde5557bf274e5afc2bddf60cff898af30362..ddd188d227710bddf0f6886a7a99eadcb3e8a4d3 100644 (file)
@@ -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();
 }