Merge branch 'fix_segfault_bc_name' into 'master'

fix segfault on query non set boundary name in 2D

See merge request jschoeberl/netgen!80
This commit is contained in:
Joachim Schöberl 2018-03-08 17:50:52 +01:00
commit c06246f3bf
2 changed files with 3 additions and 1 deletions

View File

@ -5910,6 +5910,7 @@ namespace netgen
} }
string Mesh :: cd2_default_name = "default"; string Mesh :: cd2_default_name = "default";
string Mesh :: default_bc = "default";
const string & Mesh :: GetCD2Name (int cd2nr) const const string & Mesh :: GetCD2Name (int cd2nr) const
{ {
static string defaultstring = "default"; static string defaultstring = "default";

View File

@ -625,8 +625,9 @@ namespace netgen
} }
size_t GetNCD2Names() const { return cd2names.Size(); } size_t GetNCD2Names() const { return cd2names.Size(); }
DLL_HEADER static string default_bc;
string * GetBCNamePtr (int bcnr) const string * GetBCNamePtr (int bcnr) const
{ return bcnr < bcnames.Size() ? bcnames[bcnr] : nullptr; } { return (bcnr < bcnames.Size() && bcnames[bcnr]) ? bcnames[bcnr] : &default_bc; }
/// ///
void ClearFaceDescriptors() void ClearFaceDescriptors()