From 313bb4092b930332a3705f945e86ed8a15bb83e3 Mon Sep 17 00:00:00 2001 From: jfa Date: Fri, 13 Feb 2009 13:39:12 +0000 Subject: [PATCH] Update from BR_V5_DEV 13feb09 --- bin/nameserver.py | 2 +- src/HDFPersist/HDFascii.cc | 40 +++++++++---------- .../SALOMEDSImpl_AttributeStudyProperties.cxx | 2 +- .../SALOMEDSImpl_AttributeTreeNode.cxx | 4 +- src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx | 2 +- .../SALOMEDSImpl_StudyManager.cxx | 14 +++---- 6 files changed, 32 insertions(+), 32 deletions(-) diff --git a/bin/nameserver.py b/bin/nameserver.py index 329310fba..46986f897 100755 --- a/bin/nameserver.py +++ b/bin/nameserver.py @@ -95,7 +95,7 @@ class NamingServer(Server): #print "port=", aPort if sys.platform == "win32": #print "start omniNames -start " + aPort + " -logdir " + upath - self.CMD=['omniNames -start ' , aPort , ' -logdir ' , '\"' + upath + '\"', ' -errlog', upath+'/omniNameErrors.log'] + self.CMD=['omniNames -start ' , aPort , ' -logdir ' , '\"' + upath + '\"', ' -errlog', '\"' + upath+'/omniNameErrors.log' + '\"'] #os.system("start omniNames -start " + aPort + " -logdir " + upath) else: #self.CMD=['omniNames -start ' , aPort , ' -logdir ' , upath , ' &'] diff --git a/src/HDFPersist/HDFascii.cc b/src/HDFPersist/HDFascii.cc index 2498319d6..17642df5b 100644 --- a/src/HDFPersist/HDFascii.cc +++ b/src/HDFPersist/HDFascii.cc @@ -187,12 +187,12 @@ void SaveGroupInASCIIfile(HDFgroup *hdf_group, FILE* fp, int ident) char* name = makeName(hdf_group->GetName()); fprintf(fp, "%s %i\n", name, nbsons+nbAttr); - delete name; + delete [] name; for(unsigned j=0; jGetAttributeName(j); HDFattribute *hdf_attribute = new HDFattribute(name, hdf_group); - delete name; + delete [] name; SaveAttributeInASCIIfile(hdf_attribute, fp, ident+1); hdf_attribute = 0; } @@ -241,7 +241,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) 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); @@ -251,7 +251,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) } fprintf(fp, "\n"); - delete dim; + delete [] dim; fprintf(fp, "%li %i:", size, order); @@ -259,7 +259,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) 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); @@ -272,7 +272,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) } else fprintf(fp," "); } - delete val; + delete [] val; } else if(type == HDF_INT64) { hdf_int64* val = new hdf_int64[size]; hdf_dataset->ReadFromDisk(val); @@ -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); @@ -296,7 +296,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) j = 0; } } - delete val; + delete [] val; } fprintf(fp, "\n"); @@ -305,7 +305,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) { 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; } @@ -332,7 +332,7 @@ void SaveAttributeInASCIIfile(HDFattribute *hdf_attribute, FILE* fp, int ident) 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]; @@ -340,7 +340,7 @@ void SaveAttributeInASCIIfile(HDFattribute *hdf_attribute, FILE* fp, int ident) 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); @@ -447,7 +447,7 @@ bool CreateGroupFromASCII(HDFcontainerObject *father, FILE *fp) HDFgroup* hdf_group = new HDFgroup(new_name, father); - delete new_name; + delete [] new_name; hdf_group->CreateOnDisk(); @@ -526,8 +526,8 @@ bool CreateDatasetFromASCII(HDFcontainerObject *father, FILE *fp) 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(); @@ -535,28 +535,28 @@ bool CreateDatasetFromASCII(HDFcontainerObject *father, FILE *fp) 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; iWriteOnDisk(val); - delete val; + delete [] val; } else if(type == HDF_INT64) { hdf_int64* val = new hdf_int64[size]; for(i=0; iWriteOnDisk(val); - delete val; + delete [] val; } else if(type == HDF_INT32) { hdf_int32* val = new hdf_int32[size]; for(i=0; iWriteOnDisk(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); 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..ee5457b34 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx @@ -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; } @@ -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(); } @@ -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(order,aVariable)); - delete currentVarValue; + delete [] currentVarValue; } } -- 2.39.2