Salome HOME
PAL10195: SALOME V2 study with a mesh leads to SIGSEGV of SALOME V3
authorjfa <jfa@opencascade.com>
Mon, 10 Oct 2005 10:00:24 +0000 (10:00 +0000)
committerjfa <jfa@opencascade.com>
Mon, 10 Oct 2005 10:00:24 +0000 (10:00 +0000)
src/SMESH_I/SMESH_Gen_i.cxx

index a51c17b9e46a8e43b14b785efe56d87a4bc533e8..1abae770956088b645ca49d7ae224f8c78150dcf 100644 (file)
@@ -1739,7 +1739,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
              char* hypname_str = new char[ size ];
              aDataset->ReadFromDisk( hypname_str );
              hypname = string( hypname_str );
-             delete hypname_str;
+             delete [] hypname_str;
              aDataset->CloseOnDisk();
            }
            // --> get hypothesis plugin library name
@@ -1751,7 +1751,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
              aDataset->ReadFromDisk( libname_str );
              if(MYDEBUG) SCRUTE( libname_str );
              libname = string( libname_str );
-             delete libname_str;
+             delete [] libname_str;
              aDataset->CloseOnDisk();
            }
            // --> get hypothesis data
@@ -1762,7 +1762,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
              char* hypdata_str = new char[ size ];
              aDataset->ReadFromDisk( hypdata_str );
              hypdata = string( hypdata_str );
-             delete hypdata_str;
+             delete [] hypdata_str;
              aDataset->CloseOnDisk();
            }
          }
@@ -1836,7 +1836,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
              char* hypname_str = new char[ size ];
              aDataset->ReadFromDisk( hypname_str );
              hypname = string( hypname_str );
-             delete hypname_str;
+             delete [] hypname_str;
              aDataset->CloseOnDisk();
            }
            // --> get algorithm plugin library name
@@ -1848,7 +1848,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
              aDataset->ReadFromDisk( libname_str );
              if(MYDEBUG) SCRUTE( libname_str );
              libname = string( libname_str );
-             delete libname_str;
+             delete [] libname_str;
              aDataset->CloseOnDisk();
            }
            // --> get algorithm data
@@ -1860,7 +1860,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
              aDataset->ReadFromDisk( hypdata_str );
              if(MYDEBUG) SCRUTE( hypdata_str );
              hypdata = string( hypdata_str );
-             delete hypdata_str;
+             delete [] hypdata_str;
              aDataset->CloseOnDisk();
            }
          }
@@ -2272,7 +2272,10 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
                 }
                 else // NODE IDS
                 {
-                 int aSize = aDataset->GetSize()/sizeof(int);
+                 //PAL10195:int aSize = aDataset->GetSize()/sizeof(int);
+                 int aSize = aDataset->GetSize();       //PAL10195
+                  if (aDataset->GetType() == HDF_STRING) //PAL10195
+                    aSize /= sizeof(int);                //PAL10195
                  int* ids = new int [aSize];
                   aDataset->ReadFromDisk( ids );
                   // on face or nodes?