/[escript]/trunk/finley/src/CPPAdapter/MeshAdapterFactory.cpp
ViewVC logotype

Diff of /trunk/finley/src/CPPAdapter/MeshAdapterFactory.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4479 by caltinay, Thu Jun 20 06:34:02 2013 UTC revision 4480 by caltinay, Mon Jun 24 05:09:52 2013 UTC
# Line 24  Line 24 
24  #endif  #endif
25    
26  #include <boost/python/extract.hpp>  #include <boost/python/extract.hpp>
27    #include <boost/scoped_array.hpp>
28    
29  #include <sstream>  #include <sstream>
30    
# Line 120  namespace finley { Line 121  namespace finley {
121        sprintf(error_msg,"loadMesh: Error retrieving mesh name from NetCDF file '%s'", fName.c_str());        sprintf(error_msg,"loadMesh: Error retrieving mesh name from NetCDF file '%s'", fName.c_str());
122        throw DataException(error_msg);        throw DataException(error_msg);
123      }      }
124      char *name = attr->as_string(0);      boost::scoped_array<char> name(attr->as_string(0));
125      delete attr;      delete attr;
126    
127      /* allocate mesh */      /* allocate mesh */
128      mesh_p = Finley_Mesh_alloc(name, numDim, mpi_info);      mesh_p = Finley_Mesh_alloc(name.get(), numDim, mpi_info);
129      if (Finley_noError()) {      if (Finley_noError()) {
130    
131          /* read nodes */          /* read nodes */
# Line 446  namespace finley { Line 447  namespace finley {
447                    sprintf(error_msg,"get_att(%s)", name_temp);                    sprintf(error_msg,"get_att(%s)", name_temp);
448                    cleanupAndThrow(mesh_p, mpi_info, error_msg);                    cleanupAndThrow(mesh_p, mpi_info, error_msg);
449                }                }
450                char *name = attr->as_string(0);                boost::scoped_array<char> name(attr->as_string(0));
451                delete attr;                delete attr;
452                Finley_Mesh_addTagMap(mesh_p, name, Tags_keys[i]);                Finley_Mesh_addTagMap(mesh_p, name.get(), Tags_keys[i]);
453              }              }
454              TMPMEMFREE(Tags_keys);              TMPMEMFREE(Tags_keys);
455            }            }
# Line 492  namespace finley { Line 493  namespace finley {
493          Finley_Mesh_free(mesh_p);          Finley_Mesh_free(mesh_p);
494      }      }
495    
496        Esys_MPIInfo_free(mpi_info);
497      blocktimer_increment("LoadMesh()", blocktimer_start);      blocktimer_increment("LoadMesh()", blocktimer_start);
498      return dom->getPtr();      return dom->getPtr();
499  #else  #else

Legend:
Removed from v.4479  
changed lines
  Added in v.4480

  ViewVC Help
Powered by ViewVC 1.1.26