char* name = makeName(hdf_group->GetName());
fprintf(fp, "%s %i\n", name, nbsons+nbAttr);
- delete name;
+ delete [] name;
for(unsigned j=0; j<nbAttr; j++) {
name = hdf_group->GetAttributeName(j);
HDFattribute *hdf_attribute = new HDFattribute(name, hdf_group);
- delete name;
+ delete [] name;
SaveAttributeInASCIIfile(hdf_attribute, fp, ident+1);
hdf_attribute = 0;
}
fprintf(fp, "%s\n", DATASET_ID);
fprintf(fp, "%s %i %i\n", name, type, nbAttr);
- delete name;
+ delete [] name;
hdf_dataset->GetDim(dim);
fprintf(fp, " %i\n", ndim);
}
fprintf(fp, "\n");
- delete dim;
+ delete [] dim;
fprintf(fp, "%li %i:", size, order);
char* val = new char[size];
hdf_dataset->ReadFromDisk(val);
fwrite(val, 1, size, fp);
- delete val;
+ delete [] val;
} else if (type == HDF_FLOAT64) {
hdf_float64* val = new hdf_float64[size];
hdf_dataset->ReadFromDisk(val);
}
else fprintf(fp," ");
}
- delete val;
+ delete [] val;
} else if(type == HDF_INT64) {
hdf_int64* val = new hdf_int64[size];
hdf_dataset->ReadFromDisk(val);
j = 0;
}
}
- delete val;
+ delete [] val;
} else if(type == HDF_INT32) {
hdf_int32* val = new hdf_int32[size];
hdf_dataset->ReadFromDisk(val);
j = 0;
}
}
- delete val;
+ delete [] val;
}
fprintf(fp, "\n");
{
name = hdf_dataset->GetAttributeName(j);
HDFattribute *hdf_attribute = new HDFattribute(name, hdf_dataset);
- delete name;
+ delete [] name;
SaveAttributeInASCIIfile(hdf_attribute, fp, ident+1);
hdf_attribute = 0;
}
fprintf(fp, "%s\n", ATTRIBUTE_ID);
fprintf(fp, "%s %i %i\n", name, type, size);
- delete name;
+ delete [] name;
if (type == HDF_STRING) {
char* val = new char[size+1];
fprintf(fp, ":");
fwrite(val, 1, size, fp);
fprintf(fp, "\n");
- delete val;
+ delete [] val;
} else if (type == HDF_FLOAT64) {
hdf_float64 val;
hdf_attribute->ReadFromDisk(&val);
HDFgroup* hdf_group = new HDFgroup(new_name, father);
- delete new_name;
+ delete [] new_name;
hdf_group->CreateOnDisk();
order = H5T_ORDER_NONE;
HDFdataset* hdf_dataset = new HDFdataset(new_name, father,type, sizeArray, nbDim, order);
- delete new_name;
- delete sizeArray;
+ delete [] new_name;
+ delete [] sizeArray;
hdf_dataset->CreateOnDisk();
char *val = new char[size+1];
fread(val, 1, size, fp);
hdf_dataset->WriteOnDisk(val);
- delete val;
+ delete [] val;
} else if (type == HDF_FLOAT64) {
hdf_float64* val = new hdf_float64[size];
for(i=0; i<size; i++) {
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];
hdf_attribute->CreateOnDisk();
- delete new_name;
+ delete [] new_name;
if (type == HDF_STRING) {
char tmp;
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);
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;
}
} 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 {
anAttr->Load(current_string);
}
- delete(current_string);
+ delete [] (current_string);
hdf_dataset->CloseOnDisk();
}
new_dataset->CloseOnDisk();
new_dataset = 0; //will be deleted by hdf_sco_group destructor
order = atoi(currentVarIndex);
- delete currentVarIndex;
+ delete [] currentVarIndex;
}
else
order = iVar;
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;
}
}