]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Mismatched delete / delete [] BR_V5_DEV
authoreap <eap@opencascade.com>
Fri, 6 Feb 2009 08:27:49 +0000 (08:27 +0000)
committereap <eap@opencascade.com>
Fri, 6 Feb 2009 08:27:49 +0000 (08:27 +0000)
src/HDFPersist/HDFascii.cc
src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx

index 2884311b3fb8024b001712bd33f36899c480c669..17642df5b0155c47fdcbf563599eb908b2b5ca84 100644 (file)
@@ -284,7 +284,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident)
        j = 0;
       }
     }
-    delete val;
+    delete [] val;
   } else if(type == HDF_INT32) {
     hdf_int32* val = new hdf_int32[size];
     hdf_dataset->ReadFromDisk(val);
@@ -542,21 +542,21 @@ bool CreateDatasetFromASCII(HDFcontainerObject *father, FILE *fp)
       read_float64(fp, &(val[i]));
     }
     hdf_dataset->WriteOnDisk(val);
-    delete val;
+    delete [] val;
   } else if(type == HDF_INT64) {
     hdf_int64* val = new hdf_int64[size];
     for(i=0; i<size; i++) {
       fscanf(fp, " %li", &(val[i]));
     }
     hdf_dataset->WriteOnDisk(val);
-    delete val;
+    delete [] val;
   } else if(type == HDF_INT32) {
     hdf_int32* val = new hdf_int32[size];
     for(i=0; i<size; i++) {
       fscanf(fp, " %i", &(val[i]));
     }
     hdf_dataset->WriteOnDisk(val);
-    delete val;
+    delete [] val;
   }
 
   char token[MAX_ID_SIZE];
@@ -605,7 +605,7 @@ bool CreateAttributeFromASCII(HDFinternalObject *father, FILE* fp)
 
   hdf_attribute->CreateOnDisk();
 
-  delete new_name;
+  delete [] new_name;
   
   if (type == HDF_STRING) {    
     char tmp;
@@ -614,7 +614,7 @@ bool CreateAttributeFromASCII(HDFinternalObject *father, FILE* fp)
     val[size] = (char)0;
     fread(val, 1, size, fp);
     hdf_attribute->WriteOnDisk(val);
-    delete val;
+    delete [] val;
   } else if (type == HDF_FLOAT64) {
     hdf_float64 val;
     read_float64(fp, &val);
index ddd188d227710bddf0f6886a7a99eadcb3e8a4d3..ee5457b34709f05b3e18ba06ddb4a39647bf493b 100644 (file)
@@ -125,9 +125,9 @@ SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::Open(const string& aUrl)
     char* aResultPath = HDFascii::ConvertFromASCIIToHDF(aUrl.c_str());
     aC_HDFUrl = new char[strlen(aResultPath) + 19];
     sprintf(aC_HDFUrl, "%shdf_from_ascii.hdf", aResultPath);
-    delete(aResultPath);
+    delete [] (aResultPath);
     aHDFUrl = aC_HDFUrl;
-    delete aC_HDFUrl;
+    delete [] aC_HDFUrl;
   } else {
     aHDFUrl = aUrl;
   }
@@ -1319,7 +1319,7 @@ void ReadNoteBookVariables(SALOMEDSImpl_Study* theStudy, HDFgroup* theGroup)
         new_dataset->CloseOnDisk();
         new_dataset = 0; //will be deleted by hdf_sco_group destructor
         order = atoi(currentVarIndex);
-        delete currentVarIndex;
+        delete [] currentVarIndex;
       }
       else
         order = iVar;
@@ -1337,14 +1337,14 @@ void ReadNoteBookVariables(SALOMEDSImpl_Study* theStudy, HDFgroup* theGroup)
       
       SALOMEDSImpl_GenericVariable::VariableTypes aVarType =
         SALOMEDSImpl_GenericVariable::String2VariableType(string(currentVarType));
-      delete currentVarType;
+      delete [] currentVarType;
 
       //Create variable and add it in the study
       SALOMEDSImpl_GenericVariable* aVariable = 
         new SALOMEDSImpl_ScalarVariable(aVarType,string(aVarName));
       aVariable->Load(string(currentVarValue));
       aVarsMap.insert(make_pair<int,SALOMEDSImpl_GenericVariable*>(order,aVariable));
-      delete currentVarValue;
+      delete [] currentVarValue;
     }
   }